History

lockdep: Fix preemption WARN for spurious IRQ-enable

It is valid (albeit uncommon) to call local_irq_enable() without first having called local_irq_disable(). In this case we enter lockdep_hardirqs_on*() with IRQs enabled and trip a preemption warning for using __this_cpu_read(). Use this_cpu_read() instead to avoid the warning.

Peter Zijlstra committed 6 years ago

Commit f8e48a31 parent ed3e4531 file · +2 −2Browse files

Showing the changes to kernel (1 of 1 file). Show all

Unified · Split

kernel/locking/lockdep.c+2−2
@@ -4057,7 +4057,7 @@ void lockdep_hardirqs_on_prepare(unsigned long ip) · 4056 unmodified lines
4057 if (unlikely(in_nmi()))4057 if (unlikely(in_nmi()))
4058 return;4058 return;
4059 4059
4060 if (unlikely(__this_cpu_read(lockdep_recursion)))4060 if (unlikely(this_cpu_read(lockdep_recursion)))
4061 return;4061 return;
4062 4062
4063 if (unlikely(lockdep_hardirqs_enabled())) {4063 if (unlikely(lockdep_hardirqs_enabled())) {
@@ -4126,7 +4126,7 @@ void noinstr lockdep_hardirqs_on(unsigned long ip) · 62 unmodified lines
4126 goto skip_checks;4126 goto skip_checks;
4127 }4127 }
4128 4128
4129 if (unlikely(__this_cpu_read(lockdep_recursion)))4129 if (unlikely(this_cpu_read(lockdep_recursion)))
4130 return;4130 return;
4131 4131
4132 if (lockdep_hardirqs_enabled()) {4132 if (lockdep_hardirqs_enabled()) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t