Skip to contentSkip to conversation

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

PATCH In review Alexander Gordeev 1 participant 1 message Feb 20, 2012 IRQ

lore
Share & tools
lore
#0 lore raw

PATCH 3/5 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.

---
 kernel/irq/manage.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
kernel/irq/manage.c +2 -4
index 0fa3ce9..3feab4a 100644
@@ -1106,8 +1106,7 @@ out_thread:
 		struct task_struct *t = new->thread;
 
 		new->thread = NULL;
-		if (likely(!test_bit(IRQTF_DIED, &new->thread_flags)))
-			kthread_stop(t);
+		kthread_stop(t);
 		put_task_struct(t);
 	}
 out_mput:
@@ -1217,8 +1216,7 @@ static struct irqaction *__free_irq(unsigned int irq, void *dev_id)
 #endif
 
 	if (action->thread) {
-		if (!test_bit(IRQTF_DIED, &action->thread_flags))
-			kthread_stop(action->thread);
+		kthread_stop(action->thread);
 		put_task_struct(action->thread);
 	}
 
Signature · 1 line
1.7.7.6