Commit 4cf5d77a authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Ingo Molnar

sched: fix incorrect irq lock usage in normalize_rt_tasks()

lockdep spotted this bogus irq locking. normalize_rt_tasks() can be called
from hardirq context through sysrq-n
Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 8ed36996
...@@ -7291,7 +7291,7 @@ void normalize_rt_tasks(void) ...@@ -7291,7 +7291,7 @@ void normalize_rt_tasks(void)
unsigned long flags; unsigned long flags;
struct rq *rq; struct rq *rq;
read_lock_irq(&tasklist_lock); read_lock_irqsave(&tasklist_lock, flags);
do_each_thread(g, p) { do_each_thread(g, p) {
/* /*
* Only normalize user tasks: * Only normalize user tasks:
...@@ -7317,16 +7317,16 @@ void normalize_rt_tasks(void) ...@@ -7317,16 +7317,16 @@ void normalize_rt_tasks(void)
continue; continue;
} }
spin_lock_irqsave(&p->pi_lock, flags); spin_lock(&p->pi_lock);
rq = __task_rq_lock(p); rq = __task_rq_lock(p);
normalize_task(rq, p); normalize_task(rq, p);
__task_rq_unlock(rq); __task_rq_unlock(rq);
spin_unlock_irqrestore(&p->pi_lock, flags); spin_unlock(&p->pi_lock);
} while_each_thread(g, p); } while_each_thread(g, p);
read_unlock_irq(&tasklist_lock); read_unlock_irqrestore(&tasklist_lock, flags);
} }
#endif /* CONFIG_MAGIC_SYSRQ */ #endif /* CONFIG_MAGIC_SYSRQ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment