irq_work: Add generic hardirq context callbacks
Provide a mechanism that allows running code in IRQ context. It is most useful for NMI code that needs to interact with the rest of the system -- like wakeup a task to drain buffers. Perf currently has such a mechanism, so extract that and provide it as a generic feature, independent of perf so that others may also benefit. The IRQ context callback is generated through self-IPIs where possible, or on architectures like powerpc the decrementer (the built-in timer facility) is set to generate an interrupt immediately. Architectures that don't have anything like this get to do with a callback from the timer tick. These architectures can call irq_work_run() at the tail of any IRQ handlers that might enqueue such work (like the perf IRQ handler) to avoid undue latencies in processing the work. Signed-off-by:Peter Zijlstra <a.p.zijlstra@chello.nl> Acked-by:
Kyle McMartin <kyle@mcmartin.ca> Acked-by:
Martin Schwidefsky <schwidefsky@de.ibm.com> [ various fixes ] Signed-off-by:
Huang Ying <ying.huang@intel.com> LKML-Reference: <1287036094.7768.291.camel@yhuang-dev> Signed-off-by:
Ingo Molnar <mingo@elte.hu>
Showing
- arch/sparc/kernel/pcr.c 4 additions, 4 deletionsarch/sparc/kernel/pcr.c
- arch/x86/Kconfig 1 addition, 0 deletionsarch/x86/Kconfig
- arch/x86/include/asm/entry_arch.h 2 additions, 2 deletionsarch/x86/include/asm/entry_arch.h
- arch/x86/include/asm/hardirq.h 1 addition, 1 deletionarch/x86/include/asm/hardirq.h
- arch/x86/include/asm/hw_irq.h 1 addition, 1 deletionarch/x86/include/asm/hw_irq.h
- arch/x86/include/asm/irq_vectors.h 2 additions, 2 deletionsarch/x86/include/asm/irq_vectors.h
- arch/x86/kernel/Makefile 1 addition, 0 deletionsarch/x86/kernel/Makefile
- arch/x86/kernel/cpu/perf_event.c 0 additions, 19 deletionsarch/x86/kernel/cpu/perf_event.c
- arch/x86/kernel/entry_64.S 3 additions, 3 deletionsarch/x86/kernel/entry_64.S
- arch/x86/kernel/irq.c 4 additions, 4 deletionsarch/x86/kernel/irq.c
- arch/x86/kernel/irq_work.c 30 additions, 0 deletionsarch/x86/kernel/irq_work.c
- arch/x86/kernel/irqinit.c 3 additions, 3 deletionsarch/x86/kernel/irqinit.c
- include/linux/irq_work.h 20 additions, 0 deletionsinclude/linux/irq_work.h
- include/linux/perf_event.h 2 additions, 9 deletionsinclude/linux/perf_event.h
- init/Kconfig 8 additions, 0 deletionsinit/Kconfig
- kernel/Makefile 2 additions, 0 deletionskernel/Makefile
- kernel/irq_work.c 164 additions, 0 deletionskernel/irq_work.c
- kernel/perf_event.c 5 additions, 99 deletionskernel/perf_event.c
- kernel/timer.c 5 additions, 2 deletionskernel/timer.c
Loading
Please register or sign in to comment