linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Balbir Singh <balbir@linux.vnet.ibm.com>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: 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>,
	"lizf@cn.fujitsu.com" <lizf@cn.fujitsu.com>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>
Subject: Re: [-mm patch] Show memcg information during OOM (v2)
Date: Tue, 3 Feb 2009 20:46:36 +0530	[thread overview]
Message-ID: <20090203151635.GC918@balbir.in.ibm.com> (raw)
In-Reply-To: <20090203192819.0c1e0544.kamezawa.hiroyu@jp.fujitsu.com>

* KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> [2009-02-03 19:28:19]:

> On Tue, 3 Feb 2009 15:49:21 +0530
> Balbir Singh <balbir@linux.vnet.ibm.com> wrote:
> 
> > * KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> [2009-02-03 17:04:27]:
> > 
> > > On Tue, 3 Feb 2009 12:57:01 +0530
> > > Balbir Singh <balbir@linux.vnet.ibm.com> wrote:
> > > 
> > > > Checkpatch caught an additional space, so here is the patch again
> > > > 
> > > > 
> > > > Description: Add RSS and swap to OOM output from memcg
> > > > 
> > > > From: Balbir Singh <balbir@linux.vnet.ibm.com>
> > > > 
> > > > Changelog v2..v1:
> > > > 
> > > > 1. Add more information about task's memcg and the memcg
> > > >    over it's limit
> > > > 2. Print data in KB
> > > > 3. Move the print routine outside task_lock()
> > > > 4. Use rcu_read_lock() around cgroup_path, strictly speaking it
> > > >    is not required, but relying on the current memcg implementation
> > > >    is not a good idea.
> > > > 
> > > > 
> > > > This patch displays memcg values like failcnt, usage and limit
> > > > when an OOM occurs due to memcg.
> > > > 
> > > > Thanks go out to Johannes Weiner, Li Zefan, David Rientjes,
> > > > Kamezawa Hiroyuki, Daisuke Nishimura and KOSAKI Motohiro for
> > > > review.
> > > > 
> > > 
> > > IIUC, this oom_kill is serialized by memcg_tasklist mutex.
> > > Then, you don't have to allocate buffer on stack.
> > > 
> > > 
> > > > +void mem_cgroup_print_mem_info(struct mem_cgroup *memcg, struct task_struct *p)
> > > > +{
> > > > +	struct cgroup *task_cgrp;
> > > > +	struct cgroup *mem_cgrp;
> > > > +	/*
> > > > +	 * Need a buffer on stack, can't rely on allocations.
> > > > +	 */
> > > > +	char task_memcg_name[MEM_CGROUP_OOM_BUF_SIZE];
> > > > +	char memcg_name[MEM_CGROUP_OOM_BUF_SIZE];
> > > > +	int ret;
> > > > +
> > > 
> > > making this as
> > > 
> > > static char task_memcg_name[PATH_MAX];
> > > static char memcg_name[PATH_MAX];
> > > 
> > > is ok, I think. and the patch will be more simple.
> > >
> > 
> > I am having second thoughts about this one. It introduces a standard
> > overhead of 2 pages on x86*, while the first one will work for most
> > cases and all the overhead is on stack, which disappears quickly.
> > That is the reason I did not do it in the first place and put it as a
> > NOTE.
> >  
> But *128* is tooooooo short ;)
> And, your patch makes "OOM Message Format" unstable.
> >From system administration view, it's unacceptable.
> Not printing name at all is better than "printed out sometimes you lucky"
>

OK, I have the code with PATH_MAX ready. I'll send that out.
 
-- 
	Balbir

--
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>

      reply	other threads:[~2009-02-03 15:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-03  7:20 Balbir Singh
2009-02-03  7:27 ` Balbir Singh
2009-02-03  8:04   ` KAMEZAWA Hiroyuki
2009-02-03  9:00     ` Balbir Singh
2009-02-03 10:19     ` Balbir Singh
2009-02-03 10:28       ` KAMEZAWA Hiroyuki
2009-02-03 15:16         ` Balbir Singh [this message]

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=20090203151635.GC918@balbir.in.ibm.com \
    --to=balbir@linux.vnet.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lizf@cn.fujitsu.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox