mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 3/4] genirq: No need to check IRQTF_DIED before stopping a thread handler
@ 2012-03-09 13:59 Alexander Gordeev
  2012-03-09 21:12 ` [tip:irq/core] " tip-bot for Alexander Gordeev
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Gordeev @ 2012-03-09 13:59 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: Oleg Nesterov, linux-kernel

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>
---
 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 0fa3ce9..3feab4a 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -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);
 	}
 
-- 
1.7.7.6


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [tip:irq/core] genirq: No need to check IRQTF_DIED before stopping a thread handler
  2012-03-09 13:59 [PATCH 3/4] genirq: No need to check IRQTF_DIED before stopping a thread handler Alexander Gordeev
@ 2012-03-09 21:12 ` tip-bot for Alexander Gordeev
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Alexander Gordeev @ 2012-03-09 21:12 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, agordeev, hpa, mingo, oleg, tglx

Commit-ID:  05d74efa3c72a5c40b0edeb15856c0230126313b
Gitweb:     http://git.kernel.org/tip/05d74efa3c72a5c40b0edeb15856c0230126313b
Author:     Alexander Gordeev <agordeev@redhat.com>
AuthorDate: Fri, 9 Mar 2012 14:59:40 +0100
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Fri, 9 Mar 2012 17:19:08 +0100

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>
---
 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 0fa3ce9..3feab4a 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -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);
 	}
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-03-09 21:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-09 13:59 [PATCH 3/4] genirq: No need to check IRQTF_DIED before stopping a thread handler Alexander Gordeev
2012-03-09 21:12 ` [tip:irq/core] " tip-bot for Alexander Gordeev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome