Re: vm lock contention reduction

Andrew Morton
2002-07-05T02:53:59Z

Rik van Riel wrote:
>
> On Thu, 4 Jul 2002, Andrew Morton wrote:
>
> > Of course, that change means that we wouldn't be able to throttle
> > page allocators against IO any more, and we'd have to do something
> > smarter. What a shame ;)
>
> We want something smarter anyway. It just doesn't make
> sense to throttle on one page in one memory zone while
> the pages in another zone could have already become
> freeable by now.
>

Or pages from the same zone, indeed.

I think what we're saying here is: during writeback, park the
pages somewhere out of the way. Page allocators go to sleep
on some waitqueue somewhere. Disk completion interrupts put
pages back onto the LRU and wake up waiting page allocators.

That's all fairly straightforward, but one remaining problem
is: who does the writeback? We can get large amounts of
page allocation latency due to get_request_wait(), not just
wait_on_page().

Generally, the pdflush pool should be sufficient for this but
with many spindles it is possible that the kernel will run out
of pdflush resources.

So we may still need to make page allocating processes start I/O
if wakeup_bdflush() fails to find a thread. If so, then the
implementation should prefer to make processes which are dirtying
memory start the IO.

Or provide a non-blocking try_to_submit_bio() for pdflush.

-