Re: [PATCH] mm: Implement Swap Prefetching v25

From: Con Kolivas
Date: Mon Feb 13 2006 - 19:06:39 EST


On Tue, 14 Feb 2006 07:58 am, Christoph Lameter wrote:
> On Sun, 12 Feb 2006, Con Kolivas wrote:
> > Once pages have been added to the swapped list, a timer is started,
> > testing for conditions suitable to prefetch swap pages every 5 seconds.
> > Suitable conditions are defined as lack of swapping out or in any pages,
> > and no watermark tests failing. Significant amounts of dirtied ram and
> > changes in free ram representing disk writes or reads also prevent
> > prefetching.
> >
> > It then checks that we have spare ram looking for at least 3* pages_high
> > free per zone and if it succeeds that will prefetch pages from swap into
> > the swap cache. The pages are added to the tail of the inactive list to
> > preserve LRU ordering.
>
> spare ram when swapping??? We are already under memory pressure. Why make
> it worse by getting rid of the few bits of available memory? If a system
> swaps then we are per definition in the bad performance range. Add more
> memory.

This patch only prefetches the swapped pages when idle and tacks them onto the
end of the inactive list so they will be the first thing that is removed if
we need ram in the future.

Ordinary desktops swap under ordinary workloads day to day on normal pcs. It
is extraordinary common that one workload will swap out other applications
and then when complete we have free ram, yet our applications are floundering
on swapspace.

Your solution of add more memory is unrealistic. Desktops do have a limit on
how much ram we are likely to have/can afford and our workloads have, do, and
will for ever more outstrip all available ram. A huge chunk of linux in the
wild is on these sort of desktops. This patch makes a substantial difference
to ordinary desktops, is configurable on or off and it can be runtime
enabled/disabled.

Cheers,
Con
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/