Re: [PATCH] filemap.c fixes

From: Linus Torvalds (torvalds@transmeta.com)
Date: Tue May 15 2001 - 01:48:07 EST


On Mon, 14 May 2001, Rik van Riel wrote:

> On Mon, 14 May 2001, Daniel Phillips wrote:
> >
> > How about:
> >
> > > + if (PageActive(page))
> > > + SetPageReferenced(page);
> > > + else
> > > + activate_page(page);
>
> Fine with me ...

Now, please explain to me why it's not just a simple

        SetPageReferenced(page);

and then just moving it lazily from one queue to another..

Advantage: fast and robust. Very simple.

Disadvantage: lazy queue movement. But we're already doing that for other
things (ie page_launder() already has the logic to move pages with counts
and references to the active list). So this is nothing new.

The advantage of doing the work lazily is not just simplicity: it's
actually much _faster_ to delay the work until later, because in many
cases the work never needs to be done at all (ie we might not be low on
memory, or the page ends up being moved for other reasons anyway).

Comments?

                Linus

-
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 May 15 2001 - 21:00:39 EST