From 09dff43565bd06e310e29b0309b5547ee3b86a21 Mon Sep 17 00:00:00 2001 From: Peter Zijlstra Date: Wed, 21 Apr 2010 13:02:07 -0700 Subject: [PATCH] --- yaml --- r: 190536 b: refs/heads/master c: 8b08ca52f5942c21564bbb90ccfb61053f2c26a1 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/kernel/sched.c | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index ae9e010d028d..6e4810637173 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 4b402210486c6414fe5fbfd85934a0a22da56b04 +refs/heads/master: 8b08ca52f5942c21564bbb90ccfb61053f2c26a1 diff --git a/trunk/kernel/sched.c b/trunk/kernel/sched.c index de0bd26e520a..3c2a54f70ffe 100644 --- a/trunk/kernel/sched.c +++ b/trunk/kernel/sched.c @@ -323,6 +323,15 @@ static inline struct task_group *task_group(struct task_struct *p) /* Change a task's cfs_rq and parent entity if it moves across CPUs/groups */ static inline void set_task_rq(struct task_struct *p, unsigned int cpu) { + /* + * Strictly speaking this rcu_read_lock() is not needed since the + * task_group is tied to the cgroup, which in turn can never go away + * as long as there are tasks attached to it. + * + * However since task_group() uses task_subsys_state() which is an + * rcu_dereference() user, this quiets CONFIG_PROVE_RCU. + */ + rcu_read_lock(); #ifdef CONFIG_FAIR_GROUP_SCHED p->se.cfs_rq = task_group(p)->cfs_rq[cpu]; p->se.parent = task_group(p)->se[cpu]; @@ -332,6 +341,7 @@ static inline void set_task_rq(struct task_struct *p, unsigned int cpu) p->rt.rt_rq = task_group(p)->rt_rq[cpu]; p->rt.parent = task_group(p)->rt_se[cpu]; #endif + rcu_read_unlock(); } #else