diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2011-02-23 18:52:13 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2011-02-25 14:24:21 -0500 |
commit | b5faba21a6805c33b40e258d36f57997ee1de131 (patch) | |
tree | c84ef3357ecd6e1b1cfda623136529db0e5fab6f /include/linux/irqdesc.h | |
parent | 1204e95689f9fbd245a4ce5c1b0cd0a9b77f8d25 (diff) |
genirq: Prepare the handling of shared oneshot interrupts
For level type interrupts we need to track how many threads are on
flight to avoid useless interrupt storms when not all thread handlers
have finished yet. Keep track of the woken threads and only unmask
when there are no more threads in flight.
Yes, I'm lazy and using a bitfield. But not only because I'm lazy, the
main reason is that it's way simpler than using a refcount. A refcount
based solution would need to keep track of various things like
crashing the irq thread, spurious interrupts coming in,
disables/enables, free_irq() and some more. The bitfield keeps the
tracking simple and makes things just work. It's also nicely confined
to the thread code pathes and does not require additional checks all
over the place.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
LKML-Reference: <20110223234956.388095876@linutronix.de>
Diffstat (limited to 'include/linux/irqdesc.h')
-rw-r--r-- | include/linux/irqdesc.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/irqdesc.h b/include/linux/irqdesc.h index 2f87d6441302..9eb9cd313052 100644 --- a/include/linux/irqdesc.h +++ b/include/linux/irqdesc.h | |||
@@ -28,6 +28,7 @@ struct timer_rand_state; | |||
28 | * @lock: locking for SMP | 28 | * @lock: locking for SMP |
29 | * @affinity_notify: context for notification of affinity changes | 29 | * @affinity_notify: context for notification of affinity changes |
30 | * @pending_mask: pending rebalanced interrupts | 30 | * @pending_mask: pending rebalanced interrupts |
31 | * @threads_oneshot: bitfield to handle shared oneshot threads | ||
31 | * @threads_active: number of irqaction threads currently running | 32 | * @threads_active: number of irqaction threads currently running |
32 | * @wait_for_threads: wait queue for sync_irq to wait for threaded handlers | 33 | * @wait_for_threads: wait queue for sync_irq to wait for threaded handlers |
33 | * @dir: /proc/irq/ procfs entry | 34 | * @dir: /proc/irq/ procfs entry |
@@ -86,6 +87,7 @@ struct irq_desc { | |||
86 | cpumask_var_t pending_mask; | 87 | cpumask_var_t pending_mask; |
87 | #endif | 88 | #endif |
88 | #endif | 89 | #endif |
90 | unsigned long threads_oneshot; | ||
89 | atomic_t threads_active; | 91 | atomic_t threads_active; |
90 | wait_queue_head_t wait_for_threads; | 92 | wait_queue_head_t wait_for_threads; |
91 | #ifdef CONFIG_PROC_FS | 93 | #ifdef CONFIG_PROC_FS |