diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2009-12-09 03:32:03 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-12-09 04:01:07 -0500 |
commit | dba091b9e3522b9d32fc9975e48d3b69633b45f0 (patch) | |
tree | 91549e3921971b6d0074fd34c29223b593381c8a /include/linux/sched.h | |
parent | 3160568371da441b7f2fb57f2f1225404207e8f2 (diff) |
sched: Protect sched_rr_get_param() access to task->sched_class
sched_rr_get_param calls
task->sched_class->get_rr_interval(task) without protection
against a concurrent sched_setscheduler() call which modifies
task->sched_class.
Serialize the access with task_rq_lock(task) and hand the rq
pointer into get_rr_interval() as it's needed at least in the
sched_fair implementation.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra <peterz@infradead.org>
LKML-Reference: <alpine.LFD.2.00.0912090930120.3089@localhost.localdomain>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r-- | include/linux/sched.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 89115ec7d43f..9b2402725088 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -1111,7 +1111,8 @@ struct sched_class { | |||
1111 | void (*prio_changed) (struct rq *this_rq, struct task_struct *task, | 1111 | void (*prio_changed) (struct rq *this_rq, struct task_struct *task, |
1112 | int oldprio, int running); | 1112 | int oldprio, int running); |
1113 | 1113 | ||
1114 | unsigned int (*get_rr_interval) (struct task_struct *task); | 1114 | unsigned int (*get_rr_interval) (struct rq *rq, |
1115 | struct task_struct *task); | ||
1115 | 1116 | ||
1116 | #ifdef CONFIG_FAIR_GROUP_SCHED | 1117 | #ifdef CONFIG_FAIR_GROUP_SCHED |
1117 | void (*moved_group) (struct task_struct *p); | 1118 | void (*moved_group) (struct task_struct *p); |