public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] stop_machine: disable preempt in stop machine path
@ 2009-09-16  7:26 Xiao Guangrong
  2009-09-16 23:03 ` Andrew Morton
  2009-09-22  5:50 ` Rusty Russell
  0 siblings, 2 replies; 4+ messages in thread
From: Xiao Guangrong @ 2009-09-16  7:26 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Andrew Morton, Rusty Russell, LKML

We can disable preempt in stop_cpu(), It can reduce the cpu's waiting time
and make stop_machine path faster.

Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
---
 kernel/stop_machine.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/kernel/stop_machine.c b/kernel/stop_machine.c
index 912823e..feaa947 100644
--- a/kernel/stop_machine.c
+++ b/kernel/stop_machine.c
@@ -68,7 +68,7 @@ static void stop_cpu(struct work_struct *unused)
 {
 	enum stopmachine_state curstate = STOPMACHINE_NONE;
 	struct stop_machine_data *smdata = &idle;
-	int cpu = smp_processor_id();
+	int cpu = get_cpu();
 	int err;
 
 	if (!active_cpus) {
@@ -103,6 +103,7 @@ static void stop_cpu(struct work_struct *unused)
 		}
 	} while (curstate != STOPMACHINE_EXIT);
 
+	put_cpu();
 	local_irq_enable();
 }
 
-- 
1.6.1.2


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

end of thread, other threads:[~2009-09-22  5:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-16  7:26 [PATCH] stop_machine: disable preempt in stop machine path Xiao Guangrong
2009-09-16 23:03 ` Andrew Morton
2009-09-17  1:23   ` Xiao Guangrong
2009-09-22  5:50 ` Rusty Russell

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