]> git.baikalelectronics.ru Git - kernel.git/commit
genirq: Delegate irq affinity setting to the irq thread
authorThomas Gleixner <tglx@linutronix.de>
Tue, 21 Jul 2009 09:09:39 +0000 (11:09 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 21 Jul 2009 12:35:07 +0000 (14:35 +0200)
commit1e34ca9a4a9d5ce18ba711b36dece2bc9c472ce4
treec7962a95a47bbdf664f15a504eff24c351f33613
parent64ad91c7e3b4f33fd771c9e597b2b9e9cebaf44a
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>
include/linux/interrupt.h
kernel/irq/internals.h
kernel/irq/manage.c
kernel/irq/migration.c