All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li Zefan <lizf@cn.fujitsu.com>
To: balbir@linux.vnet.ibm.com
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"nishimura@mxp.nes.nec.co.jp" <nishimura@mxp.nes.nec.co.jp>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>
Subject: Re: [-mm patch] Show memcg information during OOM
Date: Tue, 03 Feb 2009 09:29:09 +0800	[thread overview]
Message-ID: <49879DE5.8030505@cn.fujitsu.com> (raw)
In-Reply-To: <20090202140849.GB918@balbir.in.ibm.com>

> +void mem_cgroup_print_mem_info(struct mem_cgroup *memcg)
> +{
> +	printk(KERN_WARNING "Memory cgroups's name %s\n",
> +		memcg->css.cgroup->dentry->d_name.name);
> +	printk(KERN_WARNING "Memory cgroup RSS : usage %llu, limit %llu"
> +		" failcnt %llu\n", res_counter_read_u64(&memcg->res, RES_USAGE),

", failcnt %llu\n" ?

> +		res_counter_read_u64(&memcg->res, RES_LIMIT),
> +		res_counter_read_u64(&memcg->res, RES_FAILCNT));
> +	printk(KERN_WARNING "Memory cgroup swap: usage %llu, limit %llu "
> +		"failcnt %llu\n",

", failcnt %llu\n" ?

> +		res_counter_read_u64(&memcg->memsw, RES_USAGE),
> +		res_counter_read_u64(&memcg->memsw, RES_LIMIT),
> +		res_counter_read_u64(&memcg->memsw, RES_FAILCNT));
> +}
> +
>  /*
>   * Unlike exported interface, "oom" parameter is added. if oom==true,
>   * oom-killer can be invoked.
> diff --git a/mm/oom_kill.c b/mm/oom_kill.c
> index d3b9bac..b8e53ae 100644
> --- a/mm/oom_kill.c
> +++ b/mm/oom_kill.c
> @@ -392,6 +392,7 @@ static int oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order,
>  			current->comm, gfp_mask, order, current->oomkilladj);
>  		task_lock(current);
>  		cpuset_print_task_mems_allowed(current);
> +		mem_cgroup_print_mem_info(mem);

I think this can be put outside the task lock. The lock is used to call task_cs() safely in
cpuset_print_task_mems_allowed().

>  		task_unlock(current);
>  		dump_stack();
>  		show_mem();
> 

WARNING: multiple messages have this Message-ID (diff)
From: Li Zefan <lizf@cn.fujitsu.com>
To: balbir@linux.vnet.ibm.com
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"nishimura@mxp.nes.nec.co.jp" <nishimura@mxp.nes.nec.co.jp>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>
Subject: Re: [-mm patch] Show memcg information during OOM
Date: Tue, 03 Feb 2009 09:29:09 +0800	[thread overview]
Message-ID: <49879DE5.8030505@cn.fujitsu.com> (raw)
In-Reply-To: <20090202140849.GB918@balbir.in.ibm.com>

> +void mem_cgroup_print_mem_info(struct mem_cgroup *memcg)
> +{
> +	printk(KERN_WARNING "Memory cgroups's name %s\n",
> +		memcg->css.cgroup->dentry->d_name.name);
> +	printk(KERN_WARNING "Memory cgroup RSS : usage %llu, limit %llu"
> +		" failcnt %llu\n", res_counter_read_u64(&memcg->res, RES_USAGE),

", failcnt %llu\n" ?

> +		res_counter_read_u64(&memcg->res, RES_LIMIT),
> +		res_counter_read_u64(&memcg->res, RES_FAILCNT));
> +	printk(KERN_WARNING "Memory cgroup swap: usage %llu, limit %llu "
> +		"failcnt %llu\n",

", failcnt %llu\n" ?

> +		res_counter_read_u64(&memcg->memsw, RES_USAGE),
> +		res_counter_read_u64(&memcg->memsw, RES_LIMIT),
> +		res_counter_read_u64(&memcg->memsw, RES_FAILCNT));
> +}
> +
>  /*
>   * Unlike exported interface, "oom" parameter is added. if oom==true,
>   * oom-killer can be invoked.
> diff --git a/mm/oom_kill.c b/mm/oom_kill.c
> index d3b9bac..b8e53ae 100644
> --- a/mm/oom_kill.c
> +++ b/mm/oom_kill.c
> @@ -392,6 +392,7 @@ static int oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order,
>  			current->comm, gfp_mask, order, current->oomkilladj);
>  		task_lock(current);
>  		cpuset_print_task_mems_allowed(current);
> +		mem_cgroup_print_mem_info(mem);

I think this can be put outside the task lock. The lock is used to call task_cs() safely in
cpuset_print_task_mems_allowed().

>  		task_unlock(current);
>  		dump_stack();
>  		show_mem();
> 

--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2009-02-03  1:30 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-02 12:52 [-mm patch] Show memcg information during OOM Balbir Singh
2009-02-02 12:52 ` Balbir Singh
2009-02-02 12:59 ` KOSAKI Motohiro
2009-02-02 12:59   ` KOSAKI Motohiro
2009-02-02 14:12   ` Balbir Singh
2009-02-02 14:12     ` Balbir Singh
2009-02-02 14:17   ` Balbir Singh
2009-02-02 14:17     ` Balbir Singh
2009-02-02 20:37     ` David Rientjes
2009-02-02 20:37       ` David Rientjes
2009-02-02 20:54       ` Balbir Singh
2009-02-02 20:54         ` Balbir Singh
2009-02-02 21:05         ` David Rientjes
2009-02-02 21:05           ` David Rientjes
2009-02-03  4:41           ` Balbir Singh
2009-02-03  4:41             ` Balbir Singh
2009-02-03  5:41           ` Balbir Singh
2009-02-03  5:41             ` Balbir Singh
2009-02-03  5:45             ` David Rientjes
2009-02-03  5:45               ` David Rientjes
2009-02-02 13:45 ` Johannes Weiner
2009-02-02 13:45   ` Johannes Weiner
2009-02-03  3:44   ` Daisuke Nishimura
2009-02-03  3:44     ` Daisuke Nishimura
2009-02-03  5:55     ` Daisuke Nishimura
2009-02-03  5:55       ` Daisuke Nishimura
2009-02-03  6:04       ` David Rientjes
2009-02-03  6:04         ` David Rientjes
2009-02-02 14:08 ` Balbir Singh
2009-02-02 14:08   ` Balbir Singh
2009-02-03  1:21   ` KAMEZAWA Hiroyuki
2009-02-03  1:21     ` KAMEZAWA Hiroyuki
2009-02-03  4:34     ` Balbir Singh
2009-02-03  4:34       ` Balbir Singh
2009-02-03  1:29   ` Li Zefan [this message]
2009-02-03  1:29     ` Li Zefan
2009-02-03  4:41     ` Balbir Singh
2009-02-03  4:41       ` Balbir Singh
2009-02-03  4:47       ` David Rientjes
2009-02-03  4:47         ` David Rientjes
2009-02-03  4:55         ` Balbir Singh
2009-02-03  4:55           ` Balbir Singh
2009-02-03  5:25           ` David Rientjes
2009-02-03  5:25             ` David Rientjes
2009-02-03  5:33             ` Balbir Singh
2009-02-03  5:33               ` Balbir Singh
2009-02-03  5:24         ` Li Zefan
2009-02-03  5:24           ` Li Zefan
2009-02-03  5:35           ` Balbir Singh
2009-02-03  5:35             ` Balbir Singh

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=49879DE5.8030505@cn.fujitsu.com \
    --to=lizf@cn.fujitsu.com \
    --cc=akpm@linux-foundation.org \
    --cc=balbir@linux.vnet.ibm.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=nishimura@mxp.nes.nec.co.jp \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.