[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20100603084829.7234.A69D9226@jp.fujitsu.com>
Date: Thu, 3 Jun 2010 09:06:02 +0900 (JST)
From: KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
To: Minchan Kim <minchan.kim@...il.com>
Cc: kosaki.motohiro@...fujitsu.com,
LKML <linux-kernel@...r.kernel.org>,
linux-mm <linux-mm@...ck.org>, Oleg Nesterov <oleg@...hat.com>,
David Rientjes <rientjes@...gle.com>,
Andrew Morton <akpm@...ux-foundation.org>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
Nick Piggin <npiggin@...e.de>
Subject: Re: [PATCH 5/5] oom: dump_tasks() use find_lock_task_mm() too
Hi
> > @@ -344,35 +344,30 @@ static struct task_struct *select_bad_process(unsigned long *ppoints,
> > */
> > static void dump_tasks(const struct mem_cgroup *mem)
> > {
> > - struct task_struct *g, *p;
> > + struct task_struct *p;
> > + struct task_struct *task;
> >
> > printk(KERN_INFO "[ pid ] uid tgid total_vm rss cpu oom_adj "
> > "name\n");
> > - do_each_thread(g, p) {
> > +
> > + for_each_process(p) {
> > struct mm_struct *mm;
> >
> > - if (mem && !task_in_mem_cgroup(p, mem))
> > + if (is_global_init(p) || (p->flags & PF_KTHREAD))
>
> select_bad_process needs is_global_init check to not select init as victim.
> But in this case, it is just for dumping information of tasks.
But dumping oom unrelated process is useless and making confusion.
Do you have any suggestion? Instead, adding unkillable field?
>
> > continue;
> > - if (!thread_group_leader(p))
> > + if (mem && !task_in_mem_cgroup(p, mem))
> > continue;
> >
> > - task_lock(p);
> > - mm = p->mm;
> > - if (!mm) {
> > - /*
> > - * total_vm and rss sizes do not exist for tasks with no
> > - * mm so there's no need to report them; they can't be
> > - * oom killed anyway.
> > - */
>
> Please, do not remove the comment for mm newbies unless you think it's useless.
How is this?
task = find_lock_task_mm(p);
if (!task)
/*
* Probably oom vs task-exiting race was happen and ->mm
* have been detached. thus there's no need to report them;
* they can't be oom killed anyway.
*/
continue;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists