diff options
author | Alexander Gordeev <agordeev@redhat.com> | 2012-03-09 08:59:40 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2012-03-09 11:19:08 -0500 |
commit | 05d74efa3c72a5c40b0edeb15856c0230126313b (patch) | |
tree | cac8c177adbf67f3b9234341da2516fff51a50ff /kernel/irq/manage.c | |
parent | 4bcdf1d0b652bc33d52f2322b77463e4dc58abf8 (diff) |
genirq: No need to check IRQTF_DIED before stopping a thread handler
Since 63706172f332fd3f6e7458ebfb35fa6de9c21dc5 kthread_stop() is not
afraid of dead kernel threads. So no need to check if a thread is
alive before stopping it. These checks still were racy.
Reported-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
Link: http://lkml.kernel.org/r/20120309135939.GC2114@dhcp-26-207.brq.redhat.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/irq/manage.c')
-rw-r--r-- | kernel/irq/manage.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index 0fa3ce998ecb..3feab4ab6877 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c | |||
@@ -1106,8 +1106,7 @@ out_thread: | |||
1106 | struct task_struct *t = new->thread; | 1106 | struct task_struct *t = new->thread; |
1107 | 1107 | ||
1108 | new->thread = NULL; | 1108 | new->thread = NULL; |
1109 | if (likely(!test_bit(IRQTF_DIED, &new->thread_flags))) | 1109 | kthread_stop(t); |
1110 | kthread_stop(t); | ||
1111 | put_task_struct(t); | 1110 | put_task_struct(t); |
1112 | } | 1111 | } |
1113 | out_mput: | 1112 | out_mput: |
@@ -1217,8 +1216,7 @@ static struct irqaction *__free_irq(unsigned int irq, void *dev_id) | |||
1217 | #endif | 1216 | #endif |
1218 | 1217 | ||
1219 | if (action->thread) { | 1218 | if (action->thread) { |
1220 | if (!test_bit(IRQTF_DIED, &action->thread_flags)) | 1219 | kthread_stop(action->thread); |
1221 | kthread_stop(action->thread); | ||
1222 | put_task_struct(action->thread); | 1220 | put_task_struct(action->thread); |
1223 | } | 1221 | } |
1224 | 1222 | ||