[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: New patch (was Re: [PATCH] swapin readahead v3 + kswapd fixes)
On 22 Dec 1998, Eric W. Biederman wrote:
> The goal is to keep one single rogue program from outcompeting all
> of the others. With implementing a RSS limit this is accomplished
> by at some point forcing free pages to come from the program that
> needs the memory, (via swap_out) instead of directly.
>
> What currently happens is when such a program starts thrashing, is
> whenever it wakes up it steals all of the memory, and sleeps until
> it can steel some more. Because the program is a better
> competitor, than the others. With a RSS limit we would garantee
> that there is some memory left over for other programs to run in.
>
> Eventually we should attempt to autotune a programs RSS by it's
> workload, and if giving a program a larger RSS doesn't help (that
> is the program continues to thrash with an RSS we give it) we
> should scale back it's RSS, so as not to compete with other
> programs.
I have a better idea:
if (current->mm->rss > hog_pct && total_mapped > syshog_pct) {
... swap_out_process(current, GFP) swap_cluster pages ...
}
We can easily do something like this because swap_out() only
unmaps the pages and they can easily be mapped in again.
I know we tried it before and it horribly failed back then,
but now pages are not freed on swap_out(). Things have changed
in such a way that it could probably work now...
We want the above routine in one of the functions surrounding
mm/page_alloc.c::swap_in() -- this way we 'throttle at the
source'.
I know some of you think throttling at the source is a bad
thing (even for buffer cache), but you'll have to throttle
eventually and not doing it will mean you also 'throttle'
the (innocent) rest of the system...
cheers,
Rik -- the flu hits, the flu hits, the flu hits -- MORE
+-------------------------------------------------------------------+
| Linux memory management tour guide. H.H.vanRiel@phys.uu.nl |
| Scouting Vries cubscout leader. http://www.phys.uu.nl/~riel/ |
+-------------------------------------------------------------------+
--
This is a majordomo managed list. To unsubscribe, send a message with
the body 'unsubscribe linux-mm me@address' to: majordomo@kvack.org