linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Minchan Kim <minchan.kim@gmail.com>
To: David Rientjes <rientjes@google.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	Balbir Singh <balbir@linux.vnet.ibm.com>,
	"nishimura@mxp.nes.nec.co.jp" <nishimura@mxp.nes.nec.co.jp>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [BUGFIX][PATCH] memcg: fix oom killer kills a task in other cgroup
Date: Tue, 9 Feb 2010 18:40:58 +0900	[thread overview]
Message-ID: <28c262361002090140p37fac1e4q2652e7a4ee3a84d4@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1002082242180.19744@chino.kir.corp.google.com>

Hi, David.

On Tue, Feb 9, 2010 at 3:49 PM, David Rientjes <rientjes@google.com> wrote:
> On Tue, 9 Feb 2010, Minchan Kim wrote:
>
>> I think it's not only a latency problem of OOM but it is also a
>> problem of deadlock.
>> We can't expect child's lock state in oom_kill_process.
>>
>
> task_lock() is a spinlock, it shouldn't be held for any significant length
> of time and certainly not during a memory allocation which would be the
> only way we'd block in such a state during the oom killer; if that exists,
> we'd deadlock when it was chosen for kill in __oom_kill_task() anyway,
> which negates your point about oom_kill_process() and while scanning for
> tasks to kill and calling badness().  We don't have any special handling
> for GFP_ATOMIC allocations in the oom killer for locks being held while
> allocating anyway, the only thing we need to be concerned about is a
> writelock on tasklist_lock, but the oom killer only requires a readlock.
> You'd be correct if we help write_lock_irq(&tasklist_lock).

My point was following as.
We try to kill child of OOMed task at first.
But we can't know any locked state of child when OOM happens.
It means at this point child is able to be holding any lock.
So if we can try to hold task_lock of child, it could make new lock
dependency between task_lock and other locks.

Although there isn't such lock dependency now, I though it's not good.
Please correct me if I was wrong.

-- 
Kind regards,
Minchan Kim

--
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:[~2010-02-09  9:40 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-05  0:39 [BUGFIX][PATCH] memcg: fix oom killer kills a task in other cgroup KAMEZAWA Hiroyuki
2010-02-05  0:57 ` David Rientjes
2010-02-05 16:30 ` Minchan Kim
2010-02-09  0:32   ` KAMEZAWA Hiroyuki
2010-02-09  0:56     ` KAMEZAWA Hiroyuki
2010-02-09  1:24     ` Minchan Kim
2010-02-09  1:34       ` KAMEZAWA Hiroyuki
2010-02-09  6:49       ` David Rientjes
2010-02-09  7:08         ` KAMEZAWA Hiroyuki
2010-02-09  9:40         ` Minchan Kim [this message]
2010-02-09  9:55           ` David Rientjes
2010-02-09 10:18             ` Minchan Kim
2010-02-09  3:02   ` [BUGFIX][PATCH] memcg: fix oom killer kills a task in other cgroup v2 KAMEZAWA Hiroyuki
2010-02-09  7:50     ` David Rientjes
2010-02-09  8:02       ` KAMEZAWA Hiroyuki
2010-02-09  8:21         ` David Rientjes
2010-02-09  9:22           ` KAMEZAWA Hiroyuki
2010-02-09  9:35             ` David Rientjes
2010-02-09  9:27     ` 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=28c262361002090140p37fac1e4q2652e7a4ee3a84d4@mail.gmail.com \
    --to=minchan.kim@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=balbir@linux.vnet.ibm.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-mm@kvack.org \
    --cc=nishimura@mxp.nes.nec.co.jp \
    --cc=rientjes@google.com \
    /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;
as well as URLs for NNTP newsgroup(s).