]> git.baikalelectronics.ru Git - kernel.git/commitdiff
softirq: Avoid bad tracing / lockdep interaction
authorPeter Zijlstra <peterz@infradead.org>
Fri, 18 Dec 2020 15:39:14 +0000 (16:39 +0100)
committerPeter Zijlstra <peterz@infradead.org>
Fri, 18 Dec 2020 15:53:13 +0000 (16:53 +0100)
Similar to commit:

  e8ab78c32857 ("softirq: Reorder trace_softirqs_on to prevent lockdep splat")

__local_bh_enable_ip() can also call into tracing with inconsistent
state. Unlike that commit we don't need to bother about the tracepoint
because 'cnt-1' never matches preempt_count() (by construction).

Reported-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Heiko Carstens <hca@linux.ibm.com>
Link: https://lkml.kernel.org/r/20201218154519.GW3092@hirez.programming.kicks-ass.net
kernel/softirq.c

index 09229ad822096c618060be948c3c4f2914d759cf..0f1d3a32d53b3e35373035dc14d17f56bc03dae7 100644 (file)
@@ -185,7 +185,7 @@ void __local_bh_enable_ip(unsigned long ip, unsigned int cnt)
         * Keep preemption disabled until we are done with
         * softirq processing:
         */
-       preempt_count_sub(cnt - 1);
+       __preempt_count_sub(cnt - 1);
 
        if (unlikely(!in_interrupt() && local_softirq_pending())) {
                /*