提交 05d74efa 编写于 作者: A Alexander Gordeev 提交者: Thomas Gleixner

genirq: No need to check IRQTF_DIED before stopping a thread handler

Since 63706172 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: NOleg Nesterov <oleg@redhat.com>
Signed-off-by: NAlexander Gordeev <agordeev@redhat.com>
Link: http://lkml.kernel.org/r/20120309135939.GC2114@dhcp-26-207.brq.redhat.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
上级 4bcdf1d0
...@@ -1106,8 +1106,7 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new) ...@@ -1106,8 +1106,7 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
struct task_struct *t = new->thread; struct task_struct *t = new->thread;
new->thread = NULL; new->thread = NULL;
if (likely(!test_bit(IRQTF_DIED, &new->thread_flags))) kthread_stop(t);
kthread_stop(t);
put_task_struct(t); put_task_struct(t);
} }
out_mput: out_mput:
...@@ -1217,8 +1216,7 @@ static struct irqaction *__free_irq(unsigned int irq, void *dev_id) ...@@ -1217,8 +1216,7 @@ static struct irqaction *__free_irq(unsigned int irq, void *dev_id)
#endif #endif
if (action->thread) { if (action->thread) {
if (!test_bit(IRQTF_DIED, &action->thread_flags)) kthread_stop(action->thread);
kthread_stop(action->thread);
put_task_struct(action->thread); put_task_struct(action->thread);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册