Re: [PATCH] kswapd shall not sleep during page shortage

Andrew Morton
2004-11-10T02:53:29Z

Marcelo Tosatti <marcelo.tosatti@cyclades.com> wrote:
>
>
> > And in that case, they may be
> > holding locks whcih prevent kswapd from being able to do any work either.
>
> OK... Just out of curiosity:
> Isnt the "lock contention" at this level (filesystem) a relatively rare situation?
>

It should be relatively rare - most of the blocking opportunities on the
writepage path should be avoided by now - we bale out, try another page,
throttle on some I/O completion if it's all not working out.

There are probably filesystem allocation semaphores. journal_start/stop
acts as a semaphore, as does get_request_wait().

It all depends on whether you're looking for common case or worst case. In
page reclaim we should tune for the common case, and avoid deadlocking in
the worst case.