From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933200AbbIUXmt (ORCPT ); Mon, 21 Sep 2015 19:42:49 -0400 Received: from mail-pa0-f43.google.com ([209.85.220.43]:34655 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932877AbbIUXmq (ORCPT ); Mon, 21 Sep 2015 19:42:46 -0400 Date: Mon, 21 Sep 2015 16:42:44 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Oleg Nesterov cc: Michal Hocko , Linus Torvalds , Kyle Walker , Christoph Lameter , Andrew Morton , Johannes Weiner , Vladimir Davydov , linux-mm , Linux Kernel Mailing List , Stanislav Kozina , Tetsuo Handa Subject: Re: can't oom-kill zap the victim's memory? In-Reply-To: <20150921153252.GA21988@redhat.com> Message-ID: References: <1442512783-14719-1-git-send-email-kwalker@redhat.com> <20150919150316.GB31952@redhat.com> <20150920125642.GA2104@redhat.com> <20150921134414.GA15974@redhat.com> <20150921142423.GC19811@dhcp22.suse.cz> <20150921153252.GA21988@redhat.com> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.