Re: swapout selection change in pre1

Jamie Lokier
2001-01-15T09:24:45Z

Linus Torvalds wrote:
> > While we may not want to treat each thread as if it was a
> > process, I think we need more than one scan per group of threads sharing
> > memory.

> No, what we _really_ want is to penalize processes that have high
> page-fault ratios: it indicates that they have a big working set, which in
> turn is the absolute best way to find a memory hog in low-memory
> conditions.

Freeing pages aggressively from a process that's paging lots will make
that process page more, meaning more aggressive freeing etc. etc.
Either it works and reduces overall paging fairly (great), it spirals
out of control, which will be obvious, or it'll simply be stable at many
different rates which is undesirable but not so obvious in testing.

Perhaps the fair thing would be to not give a group of 35 threads 35
times as much CPU as someone else's single process. The shared VM would
then fault much as if there were a single process doing user space
threading (or Python continuations or...). That may still mean a larger
working set than a typical normal process, or it may not. But at least
fault rate based paging heuristics wouldn't be skewed by unfair
allocation of CPU time.

-- Jamie