lkml.org 
[lkml]   [2010]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH tip/core/urgent] rcu: protect fork-time cgroup access
From
Date
On Mon, 2010-03-29 at 15:43 -0700, Paul Menage wrote:
> On Mon, Mar 29, 2010 at 2:15 PM, Paul E. McKenney
> <paulmck@linux.vnet.ibm.com> wrote:
> > Add an rcu_read_lock() / rcu_read_unlock() pair to protect a fork-time
> > cgroup access. This seems likely to be a false positive.
> >
> > Located by: Alessio Igor Bogani <abogani@texware.it>
> > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> > ---
> >
> > sched.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/kernel/sched.c b/kernel/sched.c
> > index 9ab3cd7..d4bb5e0 100644
> > --- a/kernel/sched.c
> > +++ b/kernel/sched.c
> > @@ -2621,7 +2621,9 @@ void sched_fork(struct task_struct *p, int clone_flags)
> > if (p->sched_class->task_fork)
> > p->sched_class->task_fork(p);
> >
> > + rcu_read_lock();
> > set_task_cpu(p, cpu);
> > + rcu_read_unlock();
>
> I think you're right that this is a false positive - it would only be
> a problem if it were possible for the task to be moved to a different
> cgroup, and I think that shouldn't be the case at this point in the
> fork path since the new process isn't visible on the tasklist yet,
> right?

Well the thing is, this fork time invocation of
set_task_cpu()->set_task_rq() is in no way special, there's multiple
places like that.




\
 
 \ /
  Last update: 2010-03-30 10:53    [W:6.989 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site