Re: [PATCH 3/5] mm improvements

Nick Piggin
2004-02-05T02:10:53Z

Nikita Danilov wrote:

>Rik van Riel writes:
> > On Wed, 4 Feb 2004, Nick Piggin wrote:
> > > Nick Piggin wrote:
> > >
> > > > 3/5: vm-lru-info.patch
> > > > Keep more referenced info in the active list. Should also improve
> > > > system time in some cases. Helps swapping loads significantly.
> >
> > I suspect this is one of the more important ones in this
> > batch of patches...
>
>I don't understand how this works. This patch just parks mapped pages on
>the "ignored" segment of the active list, where they rest until
>reclaim_mapped mode is entered.
>
>This only makes a difference for the pages that were page_referenced():
>
>1. they are moved to the ignored segment rather than to the head of the
>active list.
>
>2. their referenced bit is not cleared
>
>

It treats all mapped pages in the same manner. Without this
patch, referenced mapped pages are distinctly disadvantaged
vs unreferenced mapped pages.

Even if reclaim_mapped is only flipped once every few
seconds it can make a big impact. On a 64MB heavily
swapping, you probably take 10 seconds to reclaim 64MB. It
is of critical importance that we keep as much hotness
information as possible.

It shows on the benchmarks too. It provides nearly as
much improvement as your patch alone for a make -j16.
ie. over 20%

http://www.kerneltrap.org/~npiggin/vm/2/

Also, when you're heavily swapping, everything slows down
to such an extent that "hot" pages are no longer touched
thousands of times per second, but maybe a few times every
few seconds. If you're continually clearing this information,
as soon as reclaim_mapped is triggered, all your hot pages
get evicted.