From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail172.messagelabs.com (mail172.messagelabs.com [216.82.254.3]) by kanga.kvack.org (Postfix) with SMTP id 4AB556B01AF for ; Wed, 16 Jun 2010 00:42:27 -0400 (EDT) Received: by iwn35 with SMTP id 35so340845iwn.14 for ; Tue, 15 Jun 2010 21:42:21 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20100616090334.d27e0c4e.kamezawa.hiroyu@jp.fujitsu.com> References: <20100615152450.f82c1f8c.kamezawa.hiroyu@jp.fujitsu.com> <20100616090334.d27e0c4e.kamezawa.hiroyu@jp.fujitsu.com> Date: Wed, 16 Jun 2010 10:12:20 +0530 Message-ID: Subject: Re: [PATCH] use find_lock_task_mm in memory cgroups oom v2 From: Balbir Singh Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Sender: owner-linux-mm@kvack.org To: KAMEZAWA Hiroyuki Cc: Minchan Kim , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , "nishimura@mxp.nes.nec.co.jp" , Oleg Nesterov , "akpm@linux-foundation.org" List-ID: On Wed, Jun 16, 2010 at 5:33 AM, KAMEZAWA Hiroyuki wrote: > On Tue, 15 Jun 2010 18:59:25 +0900 > Minchan Kim wrote: > >> > -/* >> > +/** >> > + * find_lock_task_mm - Checking a process which a task belongs to has= valid mm >> > + * and return a locked task which has a valid pointer to mm. >> > + * >> >> This comment should have been another patch. >> BTW, below comment uses "subthread" word. >> Personally it's easy to understand function's goal to me. :) >> >> How about following as? >> Checking a process which has any subthread with vaild mm >> .... >> > Sure. thank you. v2 is here. I removed unnecessary parts. > > =3D=3D > From: KAMEZAWA Hiroyuki > > When the OOM killer scans task, it check a task is under memcg or > not when it's called via memcg's context. > > But, as Oleg pointed out, a thread group leader may have NULL ->mm > and task_in_mem_cgroup() may do wrong decision. We have to use > find_lock_task_mm() in memcg as generic OOM-Killer does. > > Changelog: > =A0- removed unnecessary changes in comments. > mm->owner solves the same problem, but unfortunately we have task based selection in OOM killer, so we need this patch. It is quite ironic that we find the mm from the task and then eventually the task back from mm->owner and then the mem cgroup. If we already know the mm from oom_kill.c, I think we can change the function to work off of that. mm->owner->cgroup..no? 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: email@kvack.org