From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751039AbbI2Wm0 (ORCPT ); Tue, 29 Sep 2015 18:42:26 -0400 Received: from mail-pa0-f48.google.com ([209.85.220.48]:34349 "EHLO mail-pa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752803AbbI2Wly (ORCPT ); Tue, 29 Sep 2015 18:41:54 -0400 Date: Tue, 29 Sep 2015 15:41:52 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Oleg Nesterov cc: Andrew Morton , Kyle Walker , Michal Hocko , Stanislav Kozina , Tetsuo Handa , linux-kernel@vger.kernel.org Subject: Re: [PATCH -mm 3/3] mm/oom_kill: fix the wrong task->mm == mm checks in In-Reply-To: <20150929141822.GA10962@redhat.com> Message-ID: References: <20150929141822.GA10962@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 Tue, 29 Sep 2015, Oleg Nesterov wrote: > Both "child->mm == mm" and "p->mm != mm" checks in oom_kill_process() > are wrong. ->mm can be if task is the exited group leader. This means > in particular that "kill sharing same memory" loop can miss a process > with a zombie leader which uses the same ->mm. > > Note: the process_has_mm(child, p->mm) check is still not 100% correct, > p->mm can be NULL too. This is minor, but probably deserves a fix or a > comment anyway. > > Signed-off-by: Oleg Nesterov Acked-by: David Rientjes I like this and I don't want to hold up a fix for a personal preference, but I find process_has_mm() to simply imply the process has a non-NULL mm. Maybe process_shares_mm()? Something to consider.