From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Mon, 24 Sep 2007 21:57:55 -0700 (PDT) From: David Rientjes Subject: Re: [patch -mm 5/5] oom: add sysctl to dump tasks memory state In-Reply-To: <46F8909E.40907@linux.vnet.ibm.com> Message-ID: References: <46F8909E.40907@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-linux-mm@kvack.org Return-Path: To: Balbir Singh Cc: Andrew Morton , Andrea Arcangeli , Christoph Lameter , linux-mm@kvack.org List-ID: On Tue, 25 Sep 2007, Balbir Singh wrote: > > +static void dump_tasks(void) > > +{ > > + struct task_struct *g, *p; > > + > > + printk(KERN_INFO "[ pid ] uid tgid total_vm rss cpu oom_adj " > > + "name\n"); > > + do_each_thread(g, p) { > > + /* > > + * total_vm and rss sizes do not exist for tasks with a > > + * detached mm so there's no need to report them. > > + */ > > + if (!p->mm) > > + continue; > > + > > + task_lock(p); > > + printk(KERN_INFO "[%5d] %5d %5d %8lu %8lu %3d %3d %s\n", > > + p->pid, p->uid, p->tgid, p->mm->total_vm, > > + get_mm_rss(p->mm), (int)task_cpu(p), p->oomkilladj, > > + p->comm); > > + task_unlock(p); > > + } while_each_thread(g, p); > > +} > > + > > > I like this, but can we make this cgroup aware? To do that it would be necessary to pass the struct mem_cgroup pointer to oom_kill_process(), pass it to dump_tasks(), and filter any tasks where mm->mem_cgroup != mem. We can fold that into any changes that are made for OOM killer cgroup serialization when the time comes. -- 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