lkml.org 
[lkml]   [2013]   [Feb]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: sched: BUG in load_balance
From
Date
On Mon, 2013-02-18 at 19:55 -0500, Sasha Levin wrote:
> Hi all,
>
> While fuzzing with trinity inside a KVM tools guest, running today's -next,
> I've stumbled on the following spew.
>
> I've cc'ed Steven Rostedt since the culprit looks like "sched: Enable
> interrupts in idle_balance()".

You're correct. Interrupts are ok but softirqs must still be disabled.

The following patch should work.

-- Steve

Only compiled tested:

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 0fcdbff..a31174c 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -5222,9 +5222,9 @@ void idle_balance(int this_cpu, struct rq *this_rq)
update_rq_runnable_avg(this_rq, 1);

/*
- * Drop the rq->lock, but keep preempt disabled.
+ * Drop the rq->lock, but keep softirqs disabled.
*/
- preempt_disable();
+ local_bh_disable();
raw_spin_unlock_irq(&this_rq->lock);

update_blocked_averages(this_cpu);
@@ -5253,7 +5253,7 @@ void idle_balance(int this_cpu, struct rq *this_rq)
rcu_read_unlock();

raw_spin_lock_irq(&this_rq->lock);
- preempt_enable();
+ local_bh_enable();

if (pulled_task || time_after(jiffies, this_rq->next_balance)) {
/*



\
 
 \ /
  Last update: 2013-02-19 03:03    [W:0.054 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site