diff options
author | Tanner Love <tannerlove@google.com> | 2021-06-02 14:03:38 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2021-08-10 22:50:07 +0200 |
commit | 91cc470e797828d779cd4c1efbe8519bcb358bae (patch) | |
tree | 9f36cb2595cd78a8d9938d002800fb0bf7e9d8a6 /kernel/softirq.c | |
parent | 5a6c76b5de59ed508d7cb133327a7c54e77fed97 (diff) | |
download | lwn-91cc470e797828d779cd4c1efbe8519bcb358bae.tar.gz lwn-91cc470e797828d779cd4c1efbe8519bcb358bae.zip |
genirq: Change force_irqthreads to a static key
With CONFIG_IRQ_FORCED_THREADING=y, testing the boolean force_irqthreads
could incur a cache line miss in invoke_softirq() and other places.
Replace the test with a static key to avoid the potential cache miss.
[ tglx: Dropped the IDE part, removed the export and updated blk-mq ]
Suggested-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Tanner Love <tannerlove@google.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20210602180338.3324213-1-tannerlove.kernel@gmail.com
Diffstat (limited to 'kernel/softirq.c')
-rw-r--r-- | kernel/softirq.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/softirq.c b/kernel/softirq.c index f3a012179f47..322b65d45676 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c @@ -422,7 +422,7 @@ static inline void invoke_softirq(void) if (ksoftirqd_running(local_softirq_pending())) return; - if (!force_irqthreads || !__this_cpu_read(ksoftirqd)) { + if (!force_irqthreads() || !__this_cpu_read(ksoftirqd)) { #ifdef CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK /* * We can safely execute softirq on the current stack if |