diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-06-09 14:22:08 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-06-09 14:22:08 -0400 |
commit | a48a283489a3605058317fc9d4adcdd2bd522d20 (patch) | |
tree | d860bb7f0b4ad792b626c0dfd93cfb73408a1720 | |
parent | d360e745015548e8d9283840fc7c9ab97b702a28 (diff) |
Call __raw_get_cpu_var() instead of __get_cpu_var()
pfair_activate_plugin() is called in atomic. Calls to __get_cpu_var()
are unsafe in atomic under PreemptRT (call to smp_processor_id()).
Fix this BUG condition (triggered only with debugging kernel features
enabled):
[ 156.719784] BUG: using smp_processor_id() in preemptible [00000000] code: setsched/3084
[ 156.719791] caller is pfair_activate_plugin+0x1d/0xd0
[ 156.719795] Pid: 3084, comm: setsched Not tainted 2.6.33.5-rt22-litmus2010 #390
[ 156.719806] Call Trace:
[ 156.719812] [<ffffffff8124bccd>] debug_smp_processor_id+0xed/0xf0
[ 156.719815] [<ffffffff8123b3fd>] pfair_activate_plugin+0x1d/0xd0
[ 156.719819] [<ffffffff81233382>] switch_sched_plugin+0x142/0x1b0
[ 156.719822] [<ffffffff81233a5c>] proc_write_curr+0x6c/0xe0
[ 156.719827] [<ffffffff81580402>] ? _raw_spin_unlock_irqrestore+0x42/0x80
[ 156.719831] [<ffffffff8157eec5>] ? rt_spin_lock_slowunlock+0x55/0x90
[ 156.719836] [<ffffffff81109781>] proc_file_write+0x71/0xb0
[ 156.719839] [<ffffffff81109710>] ? proc_file_write+0x0/0xb0
[ 156.719842] [<ffffffff81103b5d>] proc_reg_write+0x7d/0xc0
[ 156.719847] [<ffffffff810b780a>] vfs_write+0xca/0x160
[ 156.719850] [<ffffffff810b7df3>] sys_write+0x53/0x90
[ 156.719855] [<ffffffff8100246b>] system_call_fastpath+0x16/0x1b
[ 156.719905] Switching to LITMUS^RT plugin PFAIR.
-rw-r--r-- | litmus/sched_pfair.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/litmus/sched_pfair.c b/litmus/sched_pfair.c index ea77d3295290..7d3544b0bdf0 100644 --- a/litmus/sched_pfair.c +++ b/litmus/sched_pfair.c | |||
@@ -821,7 +821,7 @@ static long pfair_activate_plugin(void) | |||
821 | int cpu; | 821 | int cpu; |
822 | struct pfair_state* state; | 822 | struct pfair_state* state; |
823 | 823 | ||
824 | state = &__get_cpu_var(pfair_state); | 824 | state = &__raw_get_cpu_var(pfair_state); |
825 | pfair_time = current_quantum(state); | 825 | pfair_time = current_quantum(state); |
826 | 826 | ||
827 | TRACE("Activating PFAIR at q=%lu\n", pfair_time); | 827 | TRACE("Activating PFAIR at q=%lu\n", pfair_time); |