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, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>