diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2009-07-21 05:09:39 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2009-07-21 08:35:07 -0400 |
commit | 591d2fb02ea80472d846c0b8507007806bdd69cc (patch) | |
tree | c7962a95a47bbdf664f15a504eff24c351f33613 /include | |
parent | aea1f7964ae6cba5eb419a958956deb9016b3341 (diff) |
genirq: Delegate irq affinity setting to the irq thread
irq_set_thread_affinity() calls set_cpus_allowed_ptr() which might
sleep, but irq_set_thread_affinity() is called with desc->lock held
and can be called from hard interrupt context as well. The code has
another bug as it does not hold a ref on the task struct as required
by set_cpus_allowed_ptr().
Just set the IRQTF_AFFINITY bit in action->thread_flags. The next time
the thread runs it migrates itself. Solves all of the above problems
nicely.
Add kerneldoc to irq_set_thread_affinity() while at it.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
LKML-Reference: <new-submission>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/interrupt.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 2721f07e9354..88b056ac5629 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
@@ -64,11 +64,13 @@ | |||
64 | * IRQTF_RUNTHREAD - signals that the interrupt handler thread should run | 64 | * IRQTF_RUNTHREAD - signals that the interrupt handler thread should run |
65 | * IRQTF_DIED - handler thread died | 65 | * IRQTF_DIED - handler thread died |
66 | * IRQTF_WARNED - warning "IRQ_WAKE_THREAD w/o thread_fn" has been printed | 66 | * IRQTF_WARNED - warning "IRQ_WAKE_THREAD w/o thread_fn" has been printed |
67 | * IRQTF_AFFINITY - irq thread is requested to adjust affinity | ||
67 | */ | 68 | */ |
68 | enum { | 69 | enum { |
69 | IRQTF_RUNTHREAD, | 70 | IRQTF_RUNTHREAD, |
70 | IRQTF_DIED, | 71 | IRQTF_DIED, |
71 | IRQTF_WARNED, | 72 | IRQTF_WARNED, |
73 | IRQTF_AFFINITY, | ||
72 | }; | 74 | }; |
73 | 75 | ||
74 | typedef irqreturn_t (*irq_handler_t)(int, void *); | 76 | typedef irqreturn_t (*irq_handler_t)(int, void *); |