mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paul Menage <menage@google.com>
To: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Li Zefan <lizf@cn.fujitsu.com>, Ingo Molnar <mingo@elte.hu>,
	Andrew Morton <akpm@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Subject: Re: [PATCH] sched: fix another race when reading /proc/sched_debug
Date: Tue, 16 Dec 2008 01:41:45 -0800	[thread overview]
Message-ID: <6599ad830812160141v5ed5d453h36f825b069554e57@mail.gmail.com> (raw)
In-Reply-To: <1229337829.14605.41.camel@twins>

On Mon, Dec 15, 2008 at 2:43 AM, Peter Zijlstra <a.p.zijlstra@chello.nl> wrote:
>>
>> +             /*
>> +              * Some subsystems (cpu cgroup) might still be able to
>> +              * accessing the cgroup in rcu section.
>> +              */
>> +             synchronize_rcu();
>> +
>>               kfree(cgrp);
>>       }
>>       iput(inode);
>
> Is there any reason we cannot use call_rcu() ?

It should be OK to rcu-free cgrp and have it still safe to call
cgroup_path() on it - as long as we're confident that the dentry (and
all its parents) won't be released until after the RCU section as
well, since that's where we get the path elements from. And that does
seem to be the case from looking at dcache.c

It's certainly nicer than having two calls to synchronize_rcu() in
quick succession in cgroup_diput().
>
> Perhaps wrap that check in a cgroup_*() helper? That would avoid the
> duplication, be clearer and not open code the ->dentry assumption.

I think it would be simpler to not have the cgroup exposed to the
subsystem until the dentry and other structures have been created. The
current order (create subsystems, then create fs structures) is more
or less a carry-over from when I extended cpusets, rather than an
explicit design choice.

Paul

  parent reply	other threads:[~2008-12-16  9:41 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-12  9:53 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 [this message]
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
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=6599ad830812160141v5ed5d453h36f825b069554e57@mail.gmail.com \
    --to=menage@google.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=lizf@cn.fujitsu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®