Re: [patch] swap-speedup-2.4.3-B3 (fwd)

From: Hugh Dickins (
Date: Thu Apr 26 2001 - 09:17:38 EST

On Thu, 26 Apr 2001, Linus Torvalds wrote:
> On the other hand, to offset some of these, we actually count the page
> accessed _twice_ sometimes: we count it on lookup, and we count it when we
> see the accessed bit in vmscan.c. Which results in some pages getting aged
> up twice for just one access if we go through the vmscan logic, while if
> we just map and unmap them they get counted just once.

And sometimes three times, if you count the PAGE_AGE_START bonus
points you get whenever your age is found to be 0 (or less than
PAGE_AGE_START). I think I see the idea, but seems more voodoo.

If you're looking to _simplify_ in this area, there's a confusing
host (9) of intercoupled age-up-and-down de/activate functions.
Aren't those better decoupled? i.e. the ageing ones ageonly,
the de/activate ones not messing with age at all.

Then I think you're left with just age_page_up() and age_page_down()
(maybe inlines as below, assuming the PAGE_AGE_START voodoo), plus
activate_page(), deactivate_page() and deactivate_page_nolock().

static inline void age_page_up(struct page *page)
        page->age += PAGE_AGE_ADV;
        if (page->age > PAGE_AGE_MAX)
                page->age = PAGE_AGE_MAX;
        else if (page->age < PAGE_AGE_START + PAGE_AGE_ADV)
                page->age = PAGE_AGE_START + PAGE_AGE_ADV;

static inline void age_page_down(struct page *page)
        page->age >>= 1;

But this is no more than tidying, don't let me distract you.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Mon Apr 30 2001 - 21:00:16 EST