Re: can't oom-kill zap the victim's memory?

From: David Rientjes
Date: Mon Sep 21 2015 - 19:42:52 EST


On Mon, 21 Sep 2015, Oleg Nesterov wrote:

> Yes we should try to do this in the OOM killer context, and in this case
> (of course) we need trylock. Let me quote my previous email:
>
> And we want to avoid using workqueues when the caller can do this
> directly. And in this case we certainly need trylock. But this needs
> some refactoring: we do not want to do this under oom_lock, otoh it
> makes sense to do this from mark_oom_victim() if current && killed,
> and a lot more details.
>
> and probably this is another reason why do we need MMF_MEMDIE. But again,
> I think the initial change should be simple.
>

I agree with the direction and I don't think it would be too complex to
have a dedicated kthread that is kicked when we queue an mm to do
MADV_DONTNEED behavior, and have that happen only if a trylock in
oom_kill_process() fails to do it itself for anonymous mappings. We may
have different opinions of simplicity.
--
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/