All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li Zefan <lizf@cn.fujitsu.com>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Paul Menage <menage@google.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	LKML <linux-kernel@vger.kernel.org>, Ingo Molnar <mingo@elte.hu>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] sched: fix another race when reading /proc/sched_debug
Date: Mon, 15 Dec 2008 10:11:57 +0800	[thread overview]
Message-ID: <4945BCED.9010904@cn.fujitsu.com> (raw)
In-Reply-To: <20081215105053.89263708.kamezawa.hiroyu@jp.fujitsu.com>

KAMEZAWA Hiroyuki wrote:
> On Mon, 15 Dec 2008 09:39:18 +0800
> Li Zefan <lizf@cn.fujitsu.com> wrote:
> 
>> Paul Menage wrote:
>>> I sent out some patches last week (search for hierarchy_mutex) that would
>>> mean that you'd only need to take a subsystem-local lock to keep a cgroup
>>> alive. People seemed to like them so I'll tweak them based on feedback and
>>> send them on to Andrew.
>>>
>> Unfortunately, AFAICS the proposed hierarchy_mutex can't solve this bug. :(
>>
> Hmm ? how about this way if cgroup->dentry is problem ?
> 

Sounds feasable, though the resulting code might a bit tricky.

> at creation:
>   - cpu_cgroup_populate() should record "tg" that "this cgroup has valid dentry"

This avoids /proc/sched_debug accessing invalid cgrp dentry while a cgroup is
being created.

> at deletion
>   - css_tryget() will be useful to avoid the race.

And this avoids accessing a dead task_group.

Since css_tryget() is a 2.6.29 material, I think we can have this bug fixed for
2.6.28 by holding cgroup_lock, and try to remove the global lock for 2.6.29 ?

  reply	other threads:[~2008-12-15  2:13 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-12  9:53 [PATCH] sched: fix another race when reading /proc/sched_debug Li Zefan
2008-12-12 10:00 ` Ingo Molnar
2008-12-14  2:54   ` Li Zefan
2008-12-14 12:48     ` Peter Zijlstra
2008-12-15  1:25       ` Li Zefan
2008-12-15  8:13         ` Peter Zijlstra
2008-12-15  9:51           ` Li Zefan
2008-12-15 10:43             ` Peter Zijlstra
2008-12-15 11:08               ` KAMEZAWA Hiroyuki
2008-12-16  5:48                 ` Li Zefan
2008-12-16  6:59                   ` Li Zefan
2008-12-16  9:41               ` Paul Menage
2008-12-16 12:42                 ` Paul Menage
2008-12-16 12:55                   ` Li Zefan
2008-12-16 18:35                     ` Paul Menage
     [not found]       ` <6599ad830812141347k5d7e7e08vfc17855ea0ac981c@mail.gmail.com>
2008-12-15  1:39         ` Li Zefan
2008-12-15  1:50           ` KAMEZAWA Hiroyuki
2008-12-15  2:11             ` Li Zefan [this message]
2008-12-16  9:23             ` Paul Menage
2008-12-16  9:39               ` Li Zefan
2008-12-19  4:37       ` Balbir Singh
2008-12-19 14:06         ` Paul Menage
2008-12-16  8:01     ` Li Zefan
2008-12-16 12:23       ` Ingo Molnar
2008-12-12 11:38 ` Bharata B Rao
2008-12-13  8:22   ` Li Zefan

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=4945BCED.9010904@cn.fujitsu.com \
    --to=lizf@cn.fujitsu.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=menage@google.com \
    --cc=mingo@elte.hu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.