From patchwork Wed Jun 9 17:57:09 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: 2.6.35-rc2-git1 - include/linux/cgroup.h:534 invoked rcu_dereference_check() without protection! Date: Wed, 09 Jun 2010 07:57:09 -0000 From: Peter Zijlstra X-Patchwork-Id: 55116 Message-Id: <1276106229.1745.65.camel@laptop> To: Miles Lane Cc: paulmck@linux.vnet.ibm.com, Vivek Goyal , Eric Paris , Lai Jiangshan , Ingo Molnar , LKML , nauman@google.com, eric.dumazet@gmail.com, netdev@vger.kernel.org, Jens Axboe , Gui Jianfeng , Li Zefan , Johannes Berg On Wed, 2010-06-09 at 13:00 -0400, Miles Lane wrote: > ACPI: Core revision 20100428 > [ 0.061088] > [ 0.061090] =================================================== > [ 0.062009] [ INFO: suspicious rcu_dereference_check() usage. ] > [ 0.062138] --------------------------------------------------- > [ 0.062268] kernel/sched.c:616 invoked rcu_dereference_check() > without protection! > [ 0.062470] > [ 0.062471] other info that might help us debug this: > [ 0.062472] > [ 0.062835] > [ 0.062836] rcu_scheduler_active = 1, debug_locks = 1 > [ 0.063009] no locks held by swapper/0. > [ 0.063134] > [ 0.063135] stack backtrace: > [ 0.063378] Pid: 0, comm: swapper Not tainted 2.6.35-rc2-git3 #3 > [ 0.063507] Call Trace: > [ 0.063638] [] lockdep_rcu_dereference+0x9d/0xa5 > [ 0.063773] [] task_group+0x7b/0x8a > [ 0.064012] [] set_task_rq+0x15/0x6e > [ 0.064143] [] set_task_cpu+0xa9/0xba > [ 0.064274] [] sched_fork+0x10a/0x1b3 > [ 0.064405] [] copy_process+0x617/0x10e6 > [ 0.064537] [] do_fork+0x175/0x39b > [ 0.064670] [] ? up+0xf/0x39 > [ 0.064800] [] ? up+0xf/0x39 > [ 0.065013] [] ? do_raw_spin_lock+0x79/0x13e > [ 0.065148] [] kernel_thread+0x70/0x72 > [ 0.065279] [] ? kernel_init+0x0/0x1ce > [ 0.065411] [] ? kernel_thread_helper+0x0/0x10 > [ 0.065545] [] ? rcu_scheduler_starting+0x2a/0x4c > [ 0.065679] [] rest_init+0x21/0xde > [ 0.065810] [] start_kernel+0x448/0x453 > [ 0.066013] [] x86_64_start_reservations+0xb3/0xb7 > [ 0.066148] [] x86_64_start_kernel+0x14c/0x15b > [ 0.066499] Setting APIC routing to flat Argh, moar funkeh stuff.. Either we do something like the below, or add something like (p->flags & PF_STARTING) to the task_subsys_state_check(), opinions? --- kernel/sched.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) -- 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()))