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
40574057 if (unlikely(in_nmi()))
40584058 return;
40594059
4060− if (unlikely(__this_cpu_read(lockdep_recursion)))
4060+ if (unlikely(this_cpu_read(lockdep_recursion)))
40614061 return;
40624062
40634063 if (unlikely(lockdep_hardirqs_enabled())) {
@@ -4126,7 +4126,7 @@ void noinstr lockdep_hardirqs_on(unsigned long ip) · 62 unmodified lines
41264126 goto skip_checks;
41274127 }
41284128
4129− if (unlikely(__this_cpu_read(lockdep_recursion)))
4129+ if (unlikely(this_cpu_read(lockdep_recursion)))
41304130 return;
41314131
41324132 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