Re: try_to_swap_out() deactivating pages w. count > 2

Linus Torvalds (torvalds@transmeta.com)
Sat, 21 Apr 2001 11:03:12 -0700 (PDT)


On Sat, 21 Apr 2001, Rik van Riel wrote:
> >
> > We should _absolutely_ do the swap space reclaiming without looking at
> > the page count.
>
> page->age != page->count

It's all the same thing.

The page age and count are used to decice when the page actually gets
thrown _out_ of memory. That's a decision that is based on the _physical_
page attributes.

But try_to_swap_out() is based on the attribute on this particular virtual
mapping of the page. If this particular virtual mapping does not have the
"accessed" bit set, then try_to_swap_out() should get rid of that virtual
mapping. It should absolutely not use the global page characteristics
(either global usage count or global age) in making that decision. Because
those do not matter - they have absoilutely no meaning for this virtual
mapping of the page.

Put another way: if process A is a heavy user of a page, and process B
just touched it once and will never touch it again, what do you think
should happen?

Answer: the page should be dropped from process B. It's a cheap thing to
do (we can get it back if necessary without any IO), and it means that if
we end up having toi actually swap out the page eventually, we will not be
confused by "noise" in the page count from a mappign that hasn't been
active for a long time.

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/