[patch] tweak schedule_timeout in __cpu_die

Nathan Lynch nathanl at austin.ibm.com
Wed Aug 18 04:30:11 EST 2004


Hi-

The current code does schedule_timeout(HZ) when waiting for a cpu to
die,  which is a bit coarse and tends to limit the "throughput" of my
stress tests :)

Change the HZ timeout to HZ/5, increase the number of tries to 25 so the
overall wait time is similar.  In practice, I've never seen the loop
need more than two iterations.

Signed-off-by: Nathan Lynch <nathanl at austin.ibm.com>

---


diff -puN arch/ppc64/kernel/smp.c~ppc64-cpu-death-sched-timeout arch/ppc64/kernel/smp.c
--- 2.6.8.1-mm1/arch/ppc64/kernel/smp.c~ppc64-cpu-death-sched-timeout	2004-08-16 22:25:03.000000000 -0500
+++ 2.6.8.1-mm1-nathanl/arch/ppc64/kernel/smp.c	2004-08-16 22:25:03.000000000 -0500
@@ -272,13 +272,13 @@ void __cpu_die(unsigned int cpu)
 	int cpu_status;
 	unsigned int pcpu = get_hard_smp_processor_id(cpu);

-	for (tries = 0; tries < 5; tries++) {
+	for (tries = 0; tries < 25; tries++) {
 		cpu_status = query_cpu_stopped(pcpu);

 		if (cpu_status == 0)
 			break;
 		set_current_state(TASK_UNINTERRUPTIBLE);
-		schedule_timeout(HZ);
+		schedule_timeout(HZ/5);
 	}
 	if (cpu_status != 0) {
 		printk("Querying DEAD? cpu %i (%i) shows %i\n",

_


** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc64-dev mailing list