linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.cz>
To: David Rientjes <rientjes@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	linux-mm@kvack.org
Subject: Re: [patch 3/3] mm, oom: do not emit oom killer warning if chosen thread is already exiting
Date: Thu, 12 Jan 2012 15:44:25 +0100	[thread overview]
Message-ID: <20120112144425.GB1300@tiehlicka.suse.cz> (raw)
In-Reply-To: <alpine.DEB.2.00.1201111924050.3982@chino.kir.corp.google.com>

On Wed 11-01-12 19:24:28, David Rientjes wrote:
> If a thread is chosen for oom kill and is already PF_EXITING, then the
> oom killer simply sets TIF_MEMDIE and returns.  This allows the thread to
> have access to memory reserves so that it may quickly exit.  This logic
> is preceeded with a comment saying there's no need to alarm the sysadmin.
> This patch adds truth to that statement.
> 
> There's no need to emit any warning about the oom condition if the thread
> is already exiting since it will not be killed.  In this condition, just
> silently return the oom killer since its only giving access to memory
> reserves and is otherwise a no-op.

Definitely

Reviewed-by: Michal Hocko <mhocko@suse.cz>

> 
> Signed-off-by: David Rientjes <rientjes@google.com>
> ---
>  mm/oom_kill.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/mm/oom_kill.c b/mm/oom_kill.c
> --- a/mm/oom_kill.c
> +++ b/mm/oom_kill.c
> @@ -445,9 +445,6 @@ static void oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order,
>  	struct mm_struct *mm;
>  	unsigned int victim_points = 0;
>  
> -	if (printk_ratelimit())
> -		dump_header(p, gfp_mask, order, mem, nodemask);
> -
>  	/*
>  	 * If the task is already exiting, don't alarm the sysadmin or kill
>  	 * its children or threads, just set TIF_MEMDIE so it can die quickly
> @@ -457,6 +454,9 @@ static void oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order,
>  		return;
>  	}
>  
> +	if (printk_ratelimit())
> +		dump_header(p, gfp_mask, order, mem, nodemask);
> +
>  	task_lock(p);
>  	pr_err("%s: Kill process %d (%s) score %d or sacrifice child\n",
>  		message, task_pid_nr(p), p->comm, points);
> 
> --
> 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/ .
> Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
> Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

-- 
Michal Hocko
SUSE Labs
SUSE LINUX s.r.o.
Lihovarska 1060/12
190 00 Praha 9    
Czech Republic

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2012-01-12 14:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-12  3:24 [patch 1/3] mm, oom: avoid looping when chosen thread detaches its mm David Rientjes
2012-01-12  3:24 ` [patch 2/3] mm, oom: fold oom_kill_task into oom_kill_process David Rientjes
2012-01-12  3:48   ` KOSAKI Motohiro
2012-01-12  4:48   ` KAMEZAWA Hiroyuki
2012-01-12  3:24 ` [patch 3/3] mm, oom: do not emit oom killer warning if chosen thread is already exiting David Rientjes
2012-01-12  3:48   ` KOSAKI Motohiro
2012-01-12  4:49   ` KAMEZAWA Hiroyuki
2012-01-12 14:44   ` Michal Hocko [this message]
2012-01-12  4:47 ` [patch 1/3] mm, oom: avoid looping when chosen thread detaches its mm KAMEZAWA Hiroyuki
2012-01-12 14:26 ` Michal Hocko
2012-01-14  0:39 ` [patch -mm " David Rientjes
2012-01-14  0:39   ` [patch -mm 2/3] mm, oom: fold oom_kill_task into oom_kill_process David Rientjes
2012-01-14  0:39   ` [patch -mm 3/3] mm, oom: do not emit oom killer warning if chosen thread is already exiting David Rientjes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120112144425.GB1300@tiehlicka.suse.cz \
    --to=mhocko@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-mm@kvack.org \
    --cc=rientjes@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox