From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751481Ab1IZI5M (ORCPT ); Mon, 26 Sep 2011 04:57:12 -0400 Received: from smtp-out.google.com ([74.125.121.67]:40424 "EHLO smtp-out.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750840Ab1IZI5L (ORCPT ); Mon, 26 Sep 2011 04:57:11 -0400 DomainKey-Signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=dkim-signature:date:from:x-x-sender:to:cc:subject: in-reply-to:message-id:references:user-agent:mime-version:content-type:x-system-of-record; b=ES4k7PBG+N5U5kc/3vo3c9w5fgAaYvTOlX70QWl8sxzQlOtPHVnEmwiSJ8aW1a3mE aUhuStM40VzdoeubWFr/w== Date: Mon, 26 Sep 2011 01:56:57 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Michal Hocko cc: Oleg Nesterov , Konstantin Khlebnikov , linux-mm@kvack.org, Andrew Morton , linux-kernel@vger.kernel.org, KOSAKI Motohiro , KAMEZAWA Hiroyuki , "Rafael J. Wysocki" , Tejun Heo , Rusty Russell Subject: Re: [PATCH 1/2] oom: do not live lock on frozen tasks In-Reply-To: <20110926082837.GC10156@tiehlicka.suse.cz> Message-ID: References: <20110825091920.GA22564@tiehlicka.suse.cz> <20110825151818.GA4003@redhat.com> <20110825164758.GB22564@tiehlicka.suse.cz> <20110826070946.GA7280@tiehlicka.suse.cz> <20110826085610.GA9083@tiehlicka.suse.cz> <20110826095356.GB9083@tiehlicka.suse.cz> <20110926082837.GC10156@tiehlicka.suse.cz> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-System-Of-Record: true Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 26 Sep 2011, Michal Hocko wrote: > diff --git a/mm/oom_kill.c b/mm/oom_kill.c > index 626303b..b9774f3 100644 > --- a/mm/oom_kill.c > +++ b/mm/oom_kill.c > @@ -32,6 +32,7 @@ > #include > #include > #include > +#include > > int sysctl_panic_on_oom; > int sysctl_oom_kill_allocating_task; > @@ -451,6 +452,9 @@ static int oom_kill_task(struct task_struct *p, struct mem_cgroup *mem) > task_pid_nr(q), q->comm); > task_unlock(q); > force_sig(SIGKILL, q); > + > + if (frozen(q)) > + thaw_process(q); > } > > set_tsk_thread_flag(p, TIF_MEMDIE); This is in the wrong place, oom_kill_task() iterates over all threads that are _not_ in the same thread group as the chosen thread and kills them without giving them access to memory reserves. The chosen task, p, could still be frozen and may not exit. Once that's fixed, feel free to add my Acked-by: David Rientjes once Rafael sends his acked-by or reviewed-by.