public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH]rcu: avoid unnecessary thread wakeup
@ 2011-06-10  7:50 Shaohua Li
  2011-06-10 16:38 ` Paul E. McKenney
  0 siblings, 1 reply; 3+ messages in thread
From: Shaohua Li @ 2011-06-10  7:50 UTC (permalink / raw)
  To: lkml; +Cc: paulmck, Ingo Molnar

invoke_rcu_cpu_kthread could be called in the thread itself. In this case,
we don't need call wakeup, which is just wasting CPU.

Signed-off-by: Shaohua Li <shaohua.li@intel.com>

diff --git a/kernel/rcutree.c b/kernel/rcutree.c
index 89419ff..f9bd051 100644
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -1475,7 +1475,8 @@ static void invoke_rcu_cpu_kthread(void)
 		local_irq_restore(flags);
 		return;
 	}
-	wake_up_process(__this_cpu_read(rcu_cpu_kthread_task));
+	if (current != __this_cpu_read(rcu_cpu_kthread_task))
+		wake_up_process(__this_cpu_read(rcu_cpu_kthread_task));
 	local_irq_restore(flags);
 }
 



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

end of thread, other threads:[~2011-06-13  0:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-10  7:50 [PATCH]rcu: avoid unnecessary thread wakeup Shaohua Li
2011-06-10 16:38 ` Paul E. McKenney
2011-06-13  0:36   ` Shaohua Li

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