Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

softirq/core: Consolidate default local_softirq_pending() implementations

Consolidate and optimize default softirq mask API implementations.
Per-CPU operations are expected to be faster and a few architectures
already rely on them to implement local_softirq_pending() and related
accessors/mutators. Those will be migrated to the new generic code.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: David S. Miller <davem@davemloft.net>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Helge Deller <deller@gmx.de>
Cc: James E.J. Bottomley <jejb@parisc-linux.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Rich Felker <dalias@libc.org>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Link: http://lkml.kernel.org/r/1525786706-22846-6-git-send-email-frederic@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>

authored by

Frederic Weisbecker and committed by
Ingo Molnar
0fd7d862 0f6f47ba

+15 -5
+14
include/linux/interrupt.h
··· 432 432 #define force_irqthreads (0) 433 433 #endif 434 434 435 + #ifndef local_softirq_pending 436 + 437 + #ifndef local_softirq_pending_ref 438 + #define local_softirq_pending_ref irq_stat.__softirq_pending 439 + #endif 440 + 441 + #define local_softirq_pending() (__this_cpu_read(local_softirq_pending_ref)) 442 + #define set_softirq_pending(x) (__this_cpu_write(local_softirq_pending_ref, (x))) 443 + #define or_softirq_pending(x) (__this_cpu_or(local_softirq_pending_ref, (x))) 444 + 445 + #else /* local_softirq_pending */ 446 + 435 447 #ifndef __ARCH_SET_SOFTIRQ_PENDING 436 448 #define set_softirq_pending(x) (local_softirq_pending() = (x)) 437 449 #define or_softirq_pending(x) (local_softirq_pending() |= (x)) 438 450 #endif 451 + 452 + #endif /* local_softirq_pending */ 439 453 440 454 /* Some architectures might implement lazy enabling/disabling of 441 455 * interrupts. In some cases, such as stop_machine, we might want
+1 -5
include/linux/irq_cpustat.h
··· 22 22 #define __IRQ_STAT(cpu, member) (per_cpu(irq_stat.member, cpu)) 23 23 #endif 24 24 25 - /* arch independent irq_stat fields */ 26 - #define local_softirq_pending() \ 27 - __IRQ_STAT(smp_processor_id(), __softirq_pending) 28 - 29 - /* arch dependent irq_stat fields */ 25 + /* arch dependent irq_stat fields */ 30 26 #define nmi_count(cpu) __IRQ_STAT((cpu), __nmi_count) /* i386 */ 31 27 32 28 #endif /* __irq_cpustat_h */