summaryrefslogtreecommitdiff
path: root/kernel/softirq.c
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2020-05-25 12:22:41 +0200
committerPeter Zijlstra <peterz@infradead.org>2020-07-10 12:00:02 +0200
commita21ee6055c30ce68c4e201c6496f0ed2a1936230 (patch)
tree0d929fda0e9821d2cec6181291a7ad398d68bbf1 /kernel/softirq.c
parenta6342915881a687b07847b7c57628de07a256525 (diff)
lockdep: Change hardirq{s_enabled,_context} to per-cpu variables
Currently all IRQ-tracking state is in task_struct, this means that task_struct needs to be defined before we use it. Especially for lockdep_assert_irq*() this can lead to header-hell. Move the hardirq state into per-cpu variables to avoid the task_struct dependency. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Ingo Molnar <mingo@kernel.org> Link: https://lkml.kernel.org/r/20200623083721.512673481@infradead.org
Diffstat (limited to 'kernel/softirq.c')
-rw-r--r--kernel/softirq.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/softirq.c b/kernel/softirq.c
index c4201b7f42b1..342c53feaa7a 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -107,6 +107,12 @@ static bool ksoftirqd_running(unsigned long pending)
* where hardirqs are disabled legitimately:
*/
#ifdef CONFIG_TRACE_IRQFLAGS
+
+DEFINE_PER_CPU(int, hardirqs_enabled);
+DEFINE_PER_CPU(int, hardirq_context);
+EXPORT_PER_CPU_SYMBOL_GPL(hardirqs_enabled);
+EXPORT_PER_CPU_SYMBOL_GPL(hardirq_context);
+
void __local_bh_disable_ip(unsigned long ip, unsigned int cnt)
{
unsigned long flags;