Thread (11 messages) 11 messages, 3 authors, 2020-11-19

Re: [PATCH net-next] net: add in_softirq() debug checking in napi_consume_skb()

From: Jakub Kicinski <kuba@kernel.org>
Date: 2020-11-18 16:27:16
Also in: lkml

On Wed, 18 Nov 2020 16:57:57 +0100 Peter Zijlstra wrote:
On Wed, Nov 18, 2020 at 07:43:48AM -0800, Jakub Kicinski wrote:
quoted
TBH the last sentence I wrote isn't clear even to me at this point ;D

Maybe using just the macros from preempt.h - like this?

#define lockdep_assert_in_softirq()                                    \
do {                                                                   \
       WARN_ON_ONCE(__lockdep_enabled                  &&              \
                    (!in_softirq() || in_irq() || in_nmi())	\
} while (0)

We know what we're doing so in_softirq() should be fine (famous last
words).  
So that's not actually using any lockdep state. But if that's what you
need, I don't have any real complaints.
Great, thanks! 

The motivation was to piggy back on lockdep rather than adding a
one-off Kconfig knob for a check in the fast path in networking.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help