mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paul Menage <menage@google.com>
To: paulmck@linux.vnet.ibm.com
Cc: linux-kernel@vger.kernel.org, mingo@elte.hu,
	laijs@cn.fujitsu.com, dipankar@in.ibm.com,
	akpm@linux-foundation.org, mathieu.desnoyers@polymtl.ca,
	josh@joshtriplett.org, dvhltc@us.ibm.com, niv@us.ibm.com,
	tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org,
	Valdis.Kletnieks@vt.edu, dhowells@redhat.com,
	eric.dumazet@gmail.com, abogani@texware.it
Subject: Re: [PATCH tip/core/urgent] rcu: protect fork-time cgroup access
Date: Tue, 30 Mar 2010 11:57:14 -0700	[thread overview]
Message-ID: <6599ad831003301157p155ca446lce8d6a0e7a70c10e@mail.gmail.com> (raw)
In-Reply-To: <20100329230530.GS2569@linux.vnet.ibm.com>

On Mon, Mar 29, 2010 at 4:05 PM, Paul E. McKenney
<paulmck@linux.vnet.ibm.com> wrote:
>
> So I have to ask...  What happens if the underlying cgroup is removed
> between the time sched_fork() calls set_task_cpu() and the time that
> copy_process() puts the new task on the tasklist?  Or is the initial
> cgroup guaranteed to be immortal?
>

As long as your code is running after cgroup_fork() - which
sched_fork() is - then it should be OK. cgroup_fork() takes a
reference count on the parent's cgroups set, which implicitly keeps
all of those cgroups alive until the task either exits or is moved.
But it can't be moved until it's visible on the task list.

Possibly dup_task_struct should do tsk->cgroups = NULL so that
(currently) unsafe references to the un-refcounted tsk->cgroups before
cgroup_fork() get caught.

Paul

  reply	other threads:[~2010-03-30 18:57 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-29 21:15 Paul E. McKenney
2010-03-29 21:19 ` Peter Zijlstra
2010-03-29 21:26   ` Peter Zijlstra
2010-03-29 22:24     ` Paul E. McKenney
2010-03-29 21:29   ` Paul E. McKenney
2010-03-29 21:34     ` Paul E. McKenney
2010-03-29 21:42       ` Peter Zijlstra
2010-03-29 21:51         ` Paul E. McKenney
2010-03-29 22:43 ` Paul Menage
2010-03-29 23:05   ` Paul E. McKenney
2010-03-30 18:57     ` Paul Menage [this message]
2010-03-30  8:50   ` Peter Zijlstra
2010-03-30 17:28     ` Paul E. McKenney
2010-03-30  9:32 Matt Helsley
2010-03-30 17:26 ` Paul E. McKenney

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=6599ad831003301157p155ca446lce8d6a0e7a70c10e@mail.gmail.com \
    --to=menage@google.com \
    --cc=Valdis.Kletnieks@vt.edu \
    --cc=abogani@texware.it \
    --cc=akpm@linux-foundation.org \
    --cc=dhowells@redhat.com \
    --cc=dipankar@in.ibm.com \
    --cc=dvhltc@us.ibm.com \
    --cc=eric.dumazet@gmail.com \
    --cc=josh@joshtriplett.org \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@polymtl.ca \
    --cc=mingo@elte.hu \
    --cc=niv@us.ibm.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /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®