Re: Android low memory killer vs. memory pressure notifications

From: David Rientjes
Date: Mon Dec 19 2011 - 14:05:15 EST


On Mon, 19 Dec 2011, Minchan Kim wrote:

> Kernel should have just signal role when resource is not enough.
> It is desirable that killing is role of user space.

The low memory killer becomes an out of memory killer very quickly if
(1) userspace can't respond fast enough and (2) the killed thread cannot
exit and free its memory fast enough. It also requires userspace to know
which threads are sharing memory such that they may all be killed;
otherwise, killing one thread won't lead to future memory freeing.

If the system becomes oom before userspace can kill a thread, then there's
no guarantee that it will ever be able to exit. That's fixed in the
kernel oom killer by allowing special access to memory reserves
specifically for this purpose, which userspace can't provide.

So the prerequisites for this to work correctly every time would be to
ensure that points (1) and (2) above can always happen. I'm not seeing
where that's proven, so presumably you'd still always need the kernel oom
killer.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/