Message ID | 1276106229.1745.65.camel@laptop |
---|---|
State | Not Applicable, archived |
Delegated to: | David Miller |
Headers | show |
On Wed, 2010-06-09 at 19:57 +0200, Peter Zijlstra wrote: > + /* > + * We're not in the pid-hash yet so no cgroup attach races, and the > + * cgroup is pinned by the parent running this. > + * > + * Silence PROVE_RCU. > + */ Hum,.. not sure that's actually true though, the parent itself is still susceptible to races afaict.. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Wed, Jun 9, 2010 at 2:15 PM, Peter Zijlstra <peterz@infradead.org> wrote: > On Wed, 2010-06-09 at 19:57 +0200, Peter Zijlstra wrote: >> + /* >> + * We're not in the pid-hash yet so no cgroup attach races, and the >> + * cgroup is pinned by the parent running this. >> + * >> + * Silence PROVE_RCU. >> + */ > > Hum,.. not sure that's actually true though, the parent itself is still > susceptible to races afaict.. Do you want what you sent earlier tested, or should I wait for another patch? -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Wed, 2010-06-09 at 17:15 -0400, Miles Lane wrote: > On Wed, Jun 9, 2010 at 2:15 PM, Peter Zijlstra <peterz@infradead.org> wrote: > > On Wed, 2010-06-09 at 19:57 +0200, Peter Zijlstra wrote: > >> + /* > >> + * We're not in the pid-hash yet so no cgroup attach races, and the > >> + * cgroup is pinned by the parent running this. > >> + * > >> + * Silence PROVE_RCU. > >> + */ > > > > Hum,.. not sure that's actually true though, the parent itself is still > > susceptible to races afaict.. > > Do you want what you sent earlier tested, or should I wait for another patch? please wait, I need to sit down and sort out that code. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/kernel/sched.c b/kernel/sched.c index 19b3c5d..bfd3128 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -2564,7 +2564,15 @@ void sched_fork(struct task_struct *p, int clone_flags) if (p->sched_class->task_fork) p->sched_class->task_fork(p); + /* + * We're not in the pid-hash yet so no cgroup attach races, and the + * cgroup is pinned by the parent running this. + * + * Silence PROVE_RCU. + */ + rcu_read_lock(); set_task_cpu(p, cpu); + rcu_read_unlock(); #if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) if (likely(sched_info_on()))