From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx168.postini.com [74.125.245.168]) by kanga.kvack.org (Postfix) with SMTP id 28F036B0068 for ; Tue, 19 Jun 2012 20:41:41 -0400 (EDT) Received: from m1.gw.fujitsu.co.jp (unknown [10.0.50.71]) by fgwmail6.fujitsu.co.jp (Postfix) with ESMTP id 19D6B3EE0B5 for ; Wed, 20 Jun 2012 09:41:39 +0900 (JST) Received: from smail (m1 [127.0.0.1]) by outgoing.m1.gw.fujitsu.co.jp (Postfix) with ESMTP id 011EA45DE59 for ; Wed, 20 Jun 2012 09:41:39 +0900 (JST) Received: from s1.gw.fujitsu.co.jp (s1.gw.fujitsu.co.jp [10.0.50.91]) by m1.gw.fujitsu.co.jp (Postfix) with ESMTP id DC75245DE56 for ; Wed, 20 Jun 2012 09:41:38 +0900 (JST) Received: from s1.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s1.gw.fujitsu.co.jp (Postfix) with ESMTP id CB46EE08001 for ; Wed, 20 Jun 2012 09:41:38 +0900 (JST) Received: from m1000.s.css.fujitsu.com (m1000.s.css.fujitsu.com [10.240.81.136]) by s1.gw.fujitsu.co.jp (Postfix) with ESMTP id 7BBD41DB804C for ; Wed, 20 Jun 2012 09:41:38 +0900 (JST) Message-ID: <4FE11B6C.6020706@jp.fujitsu.com> Date: Wed, 20 Jun 2012 09:38:04 +0900 From: Kamezawa Hiroyuki MIME-Version: 1.0 Subject: Re: [patch v3] mm, oom: do not schedule if current has been killed References: <4FDFDCA7.8060607@jp.fujitsu.com> <20120619135551.GA24542@redhat.com> <4FE0F1A9.7050607@gmail.com> In-Reply-To: <4FE0F1A9.7050607@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: KOSAKI Motohiro Cc: David Rientjes , Oleg Nesterov , Andrew Morton , KOSAKI Motohiro , linux-mm@kvack.org (2012/06/20 6:39), KOSAKI Motohiro wrote: > (6/19/12 4:58 PM), David Rientjes wrote: >> The oom killer currently schedules away from current in an >> uninterruptible sleep if it does not have access to memory reserves. >> It's possible that current was killed because it shares memory with the >> oom killed thread or because it was killed by the user in the interim, >> however. >> >> This patch only schedules away from current if it does not have a pending >> kill, i.e. if it does not share memory with the oom killed thread. It's >> possible that it will immediately retry its memory allocation and fail, >> but it will immediately be given access to memory reserves if it calls >> the oom killer again. >> >> This prevents the delay of memory freeing when threads that share memory >> with the oom killed thread get unnecessarily scheduled. >> >> Signed-off-by: David Rientjes >> --- >> mm/oom_kill.c | 11 +++++------ >> 1 file changed, 5 insertions(+), 6 deletions(-) >> >> diff --git a/mm/oom_kill.c b/mm/oom_kill.c >> --- a/mm/oom_kill.c >> +++ b/mm/oom_kill.c >> @@ -746,11 +746,11 @@ out: >> read_unlock(&tasklist_lock); >> >> /* >> - * Give "p" a good chance of killing itself before we >> - * retry to allocate memory unless "p" is current >> + * Give the killed threads a good chance of exiting before trying to >> + * allocate memory again. >> */ >> - if (killed&& !test_thread_flag(TIF_MEMDIE)) >> - schedule_timeout_uninterruptible(1); >> + if (killed) >> + schedule_timeout_killable(1); >> } > > This is not match I expected. but I have no seen a big problem. > > Acked-by: KOSAKI Motohiro > Acked-by: KAMEZAWA Hiroyuki I'll check memcg part to make it consistent to this when this goes to -mm. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org