Skip to content

Commit

Permalink
sched: fix incorrect irq lock usage in normalize_rt_tasks()
Browse files Browse the repository at this point in the history
lockdep spotted this bogus irq locking. normalize_rt_tasks() can be called
from hardirq context through sysrq-n

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Feb 13, 2008
1 parent 8ed3699 commit 4cf5d77
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -7291,7 +7291,7 @@ void normalize_rt_tasks(void)
unsigned long flags;
struct rq *rq;

read_lock_irq(&tasklist_lock);
read_lock_irqsave(&tasklist_lock, flags);
do_each_thread(g, p) {
/*
* Only normalize user tasks:
Expand All @@ -7317,16 +7317,16 @@ void normalize_rt_tasks(void)
continue;
}

spin_lock_irqsave(&p->pi_lock, flags);
spin_lock(&p->pi_lock);
rq = __task_rq_lock(p);

normalize_task(rq, p);

__task_rq_unlock(rq);
spin_unlock_irqrestore(&p->pi_lock, flags);
spin_unlock(&p->pi_lock);
} while_each_thread(g, p);

read_unlock_irq(&tasklist_lock);
read_unlock_irqrestore(&tasklist_lock, flags);
}

#endif /* CONFIG_MAGIC_SYSRQ */
Expand Down

0 comments on commit 4cf5d77

Please sign in to comment.