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

Merge branch 'core/irq_work' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks into irq/core

irq_work fixes and cleanups, in preparation for full dyntics support.

Signed-off-by: Ingo Molnar <mingo@kernel.org>

+15 -24
-1
arch/alpha/Kconfig
··· 5 5 select HAVE_IDE 6 6 select HAVE_OPROFILE 7 7 select HAVE_SYSCALL_WRAPPERS 8 - select HAVE_IRQ_WORK 9 8 select HAVE_PCSPKR_PLATFORM 10 9 select HAVE_PERF_EVENTS 11 10 select HAVE_DMA_ATTRS
-1
arch/arm/Kconfig
··· 36 36 select HAVE_GENERIC_HARDIRQS 37 37 select HAVE_HW_BREAKPOINT if (PERF_EVENTS && (CPU_V6 || CPU_V6K || CPU_V7)) 38 38 select HAVE_IDE if PCI || ISA || PCMCIA 39 - select HAVE_IRQ_WORK 40 39 select HAVE_KERNEL_GZIP 41 40 select HAVE_KERNEL_LZMA 42 41 select HAVE_KERNEL_LZO
-1
arch/arm64/Kconfig
··· 21 21 select HAVE_GENERIC_DMA_COHERENT 22 22 select HAVE_GENERIC_HARDIRQS 23 23 select HAVE_HW_BREAKPOINT if PERF_EVENTS 24 - select HAVE_IRQ_WORK 25 24 select HAVE_MEMBLOCK 26 25 select HAVE_PERF_EVENTS 27 26 select IRQ_DOMAIN
-1
arch/blackfin/Kconfig
··· 24 24 select HAVE_FUNCTION_TRACER 25 25 select HAVE_FUNCTION_TRACE_MCOUNT_TEST 26 26 select HAVE_IDE 27 - select HAVE_IRQ_WORK 28 27 select HAVE_KERNEL_GZIP if RAMKERNEL 29 28 select HAVE_KERNEL_BZIP2 if RAMKERNEL 30 29 select HAVE_KERNEL_LZMA if RAMKERNEL
-1
arch/frv/Kconfig
··· 3 3 default y 4 4 select HAVE_IDE 5 5 select HAVE_ARCH_TRACEHOOK 6 - select HAVE_IRQ_WORK 7 6 select HAVE_PERF_EVENTS 8 7 select HAVE_UID16 9 8 select HAVE_GENERIC_HARDIRQS
-1
arch/hexagon/Kconfig
··· 14 14 # select HAVE_CLK 15 15 # select IRQ_PER_CPU 16 16 # select GENERIC_PENDING_IRQ if SMP 17 - select HAVE_IRQ_WORK 18 17 select GENERIC_ATOMIC64 19 18 select HAVE_PERF_EVENTS 20 19 select HAVE_GENERIC_HARDIRQS
-1
arch/mips/Kconfig
··· 4 4 select HAVE_GENERIC_DMA_COHERENT 5 5 select HAVE_IDE 6 6 select HAVE_OPROFILE 7 - select HAVE_IRQ_WORK 8 7 select HAVE_PERF_EVENTS 9 8 select PERF_USE_VMALLOC 10 9 select HAVE_ARCH_KGDB
-1
arch/parisc/Kconfig
··· 9 9 select RTC_DRV_GENERIC 10 10 select INIT_ALL_POSSIBLE 11 11 select BUG 12 - select HAVE_IRQ_WORK 13 12 select HAVE_PERF_EVENTS 14 13 select GENERIC_ATOMIC64 if !64BIT 15 14 select HAVE_GENERIC_HARDIRQS
-1
arch/powerpc/Kconfig
··· 118 118 select HAVE_SYSCALL_WRAPPERS if PPC64 119 119 select GENERIC_ATOMIC64 if PPC32 120 120 select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE 121 - select HAVE_IRQ_WORK 122 121 select HAVE_PERF_EVENTS 123 122 select HAVE_REGS_AND_STACK_ACCESS_API 124 123 select HAVE_HW_BREAKPOINT if PERF_EVENTS && PPC_BOOK3S_64
-1
arch/s390/Kconfig
··· 78 78 select HAVE_KVM if 64BIT 79 79 select HAVE_ARCH_TRACEHOOK 80 80 select INIT_ALL_POSSIBLE 81 - select HAVE_IRQ_WORK 82 81 select HAVE_PERF_EVENTS 83 82 select ARCH_HAVE_NMI_SAFE_CMPXCHG 84 83 select HAVE_DEBUG_KMEMLEAK
-1
arch/sh/Kconfig
··· 11 11 select HAVE_ARCH_TRACEHOOK 12 12 select HAVE_DMA_API_DEBUG 13 13 select HAVE_DMA_ATTRS 14 - select HAVE_IRQ_WORK 15 14 select HAVE_PERF_EVENTS 16 15 select HAVE_DEBUG_BUGVERBOSE 17 16 select ARCH_HAVE_CUSTOM_GPIO_H
-1
arch/sparc/Kconfig
··· 23 23 select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE 24 24 select RTC_CLASS 25 25 select RTC_DRV_M48T59 26 - select HAVE_IRQ_WORK 27 26 select HAVE_DMA_ATTRS 28 27 select HAVE_DMA_API_DEBUG 29 28 select HAVE_ARCH_JUMP_LABEL
-1
arch/x86/Kconfig
··· 28 28 select HAVE_OPROFILE 29 29 select HAVE_PCSPKR_PLATFORM 30 30 select HAVE_PERF_EVENTS 31 - select HAVE_IRQ_WORK 32 31 select HAVE_IOREMAP_PROT 33 32 select HAVE_KPROBES 34 33 select HAVE_MEMBLOCK
-1
drivers/staging/iio/trigger/Kconfig
··· 21 21 config IIO_SYSFS_TRIGGER 22 22 tristate "SYSFS trigger" 23 23 depends on SYSFS 24 - depends on HAVE_IRQ_WORK 25 24 select IRQ_WORK 26 25 help 27 26 Provides support for using SYSFS entry as IIO triggers.
-4
init/Kconfig
··· 20 20 bool 21 21 depends on !UML 22 22 23 - config HAVE_IRQ_WORK 24 - bool 25 - 26 23 config IRQ_WORK 27 24 bool 28 - depends on HAVE_IRQ_WORK 29 25 30 26 config BUILDTIME_EXTABLE_SORT 31 27 bool
+15 -6
kernel/irq_work.c
··· 34 34 */ 35 35 static bool irq_work_claim(struct irq_work *work) 36 36 { 37 - unsigned long flags, nflags; 37 + unsigned long flags, oflags, nflags; 38 38 39 + /* 40 + * Start with our best wish as a premise but only trust any 41 + * flag value after cmpxchg() result. 42 + */ 43 + flags = work->flags & ~IRQ_WORK_PENDING; 39 44 for (;;) { 40 - flags = work->flags; 41 - if (flags & IRQ_WORK_PENDING) 42 - return false; 43 45 nflags = flags | IRQ_WORK_FLAGS; 44 - if (cmpxchg(&work->flags, flags, nflags) == flags) 46 + oflags = cmpxchg(&work->flags, flags, nflags); 47 + if (oflags == flags) 45 48 break; 49 + if (oflags & IRQ_WORK_PENDING) 50 + return false; 51 + flags = oflags; 46 52 cpu_relax(); 47 53 } 48 54 ··· 125 119 /* 126 120 * Clear the PENDING bit, after this point the @work 127 121 * can be re-used. 122 + * Make it immediately visible so that other CPUs trying 123 + * to claim that work don't rely on us to handle their data 124 + * while we are in the middle of the func. 128 125 */ 129 - work->flags = IRQ_WORK_BUSY; 126 + xchg(&work->flags, IRQ_WORK_BUSY); 130 127 work->func(work); 131 128 /* 132 129 * Clear the BUSY bit and return to the free state if