Commit ab63a633cf072c719f885e46fa4814624312f672
1 parent
143a5d325d
Exists in
master
and in
4 other branches
sched: fix unconditional irq lock
Lockdep noticed that this lock can also be taken from hardirq context, and can thus not unconditionally disable/enable irqs. WARNING: at kernel/lockdep.c:2033 trace_hardirqs_on() [show_trace_log_lvl+26/48] show_trace_log_lvl+0x1a/0x30 [show_trace+18/32] show_trace+0x12/0x20 [dump_stack+22/32] dump_stack+0x16/0x20 [trace_hardirqs_on+405/416] trace_hardirqs_on+0x195/0x1a0 [_read_unlock_irq+34/48] _read_unlock_irq+0x22/0x30 [sched_debug_show+2615/4224] sched_debug_show+0xa37/0x1080 [show_state_filter+326/368] show_state_filter+0x146/0x170 [sysrq_handle_showstate+10/16] sysrq_handle_showstate+0xa/0x10 [__handle_sysrq+123/288] __handle_sysrq+0x7b/0x120 [handle_sysrq+40/64] handle_sysrq+0x28/0x40 [kbd_event+1045/1680] kbd_event+0x415/0x690 [input_pass_event+206/208] input_pass_event+0xce/0xd0 [input_handle_event+170/928] input_handle_event+0xaa/0x3a0 [input_event+95/112] input_event+0x5f/0x70 [atkbd_interrupt+434/1456] atkbd_interrupt+0x1b2/0x5b0 [serio_interrupt+59/128] serio_interrupt+0x3b/0x80 [i8042_interrupt+263/576] i8042_interrupt+0x107/0x240 [handle_IRQ_event+40/96] handle_IRQ_event+0x28/0x60 [handle_edge_irq+175/320] handle_edge_irq+0xaf/0x140 [do_IRQ+64/128] do_IRQ+0x40/0x80 [common_interrupt+46/52] common_interrupt+0x2e/0x34 Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Showing 1 changed file with 3 additions and 2 deletions Side-by-side Diff
kernel/sched_debug.c
... | ... | @@ -80,6 +80,7 @@ |
80 | 80 | static void print_rq(struct seq_file *m, struct rq *rq, int rq_cpu) |
81 | 81 | { |
82 | 82 | struct task_struct *g, *p; |
83 | + unsigned long flags; | |
83 | 84 | |
84 | 85 | SEQ_printf(m, |
85 | 86 | "\nrunnable tasks:\n" |
... | ... | @@ -88,7 +89,7 @@ |
88 | 89 | "------------------------------------------------------" |
89 | 90 | "----------------------------------------------------\n"); |
90 | 91 | |
91 | - read_lock_irq(&tasklist_lock); | |
92 | + read_lock_irqsave(&tasklist_lock, flags); | |
92 | 93 | |
93 | 94 | do_each_thread(g, p) { |
94 | 95 | if (!p->se.on_rq || task_cpu(p) != rq_cpu) |
... | ... | @@ -97,7 +98,7 @@ |
97 | 98 | print_task(m, rq, p); |
98 | 99 | } while_each_thread(g, p); |
99 | 100 | |
100 | - read_unlock_irq(&tasklist_lock); | |
101 | + read_unlock_irqrestore(&tasklist_lock, flags); | |
101 | 102 | } |
102 | 103 | |
103 | 104 | void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq) |