Re: [patch 04/12] mm: oom_kill: remove unnecessary locking in exit_oom_victim()

Johannes Weiner
2015-03-26T15:04:30Z

On Thu, Mar 26, 2015 at 01:53:48PM +0100, Michal Hocko wrote:
> On Wed 25-03-15 02:17:08, Johannes Weiner wrote:
> > Right now the only waiter is suspend code, which achieves quiescence
> > by disabling the OOM killer. But later on we want to add waits that
> > hold the lock instead to stop new victims from showing up.
>
> It is not entirely clear what you mean by this from the current context.
> exit_oom_victim is not called from any context which would be locked by
> any OOM internals so it should be safe to use the locking.

A later patch will add another wait_event() to wait for oom victims to
drop to zero. But that new consumer won't be disabling the OOM killer
to prevent new victims from showing up, it will just hold the lock to
exclude OOM kills. So the exiting victims shouldn't get stuck on that
lock which the guy that is waiting for them is holding.