Re: Addendum to Daniel Phillips [RFC] use-once patch

From: Steven Walter (srwalter@yahoo.com)
Date: Fri Jul 27 2001 - 21:14:59 EST


On Fri, Jul 27, 2001 at 04:38:18PM +0200, Daniel Phillips wrote:
> > may be
> > + * it is the best candidate for swapping.
> > + */
> > + if ((page->age > PAGE_AGE_MAX) && (page_count(page)
> > <= 1)) {
> > + page->age = PAGE_AGE_START;
> > + } else {
> > + page->age += PAGE_AGE_ADV;
> > + if (page->age > PAGE_AGE_MAX) {
> > + page->age = PAGE_AGE_MAX;
> > + }
> > + return;
> > + }
>
> I noticed your good benchmark results below, but I'm having some
> trouble understanding how this works. How can page->age ever become
> greater than PAGE_AGE_MAX? Also, I don't see any reference to
> PAGE_MAX_USE. Comments?

What if page->age is equal to PAGE_AGE_MAX when it hits the 'else'
statement. It will be unconditionally incremented by PAGE_AGE_ADV, and
then it will be greater than PAGE_AGE_MAX. The inner 'if' statement
catches this, and sets the age back to PAGE_AGE_MAX

-- 
-Steven
In a time of universal deceit, telling the truth is a revolutionary act.
			-- George Orwell
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Jul 31 2001 - 21:00:36 EST