Re: [2.6.25-rc1] System no longer powers off after shutdown

From: Ingo Molnar
Date: Thu Feb 14 2008 - 18:49:58 EST



* Yinghai Lu <yhlu.kernel@xxxxxxxxx> wrote:

> after disable cpufreq, i got
>
> ACPI: Preparing to enter system sleep state S5
> Disabling non-boot CPUs ...
> kvm: disabling virtualization on CPU1
> CPU 1 is now offline
> CPU1 is down
> kvm: disabling virtualization on CPU2
> CPU 2 is now offline
> ================> hang here.
>
> but x86.git/mm could go through down all the cpus....
>
> interesting...

i suspect some kobject related race, and i have the feeling this all is
timing dependent.

Andrew started seeing reboot hangs roughly around the time when the
kobject changes went upstream. Given that x86.git had flux in that
timeframe too i couldnt be sure what caused them.

i have the fixlet below in x86.git but it didnt solve Andrew's problem
so it's parking now at the end of the queue, with no clear purpose in
life :-) If it would solve someone's problem it might be revitalized.

Note: this does not fix any particular bug i know about, it's just a
hack.

Ingo

------------------------------>
Subject: x86: highprio shutdown hack
From: Ingo Molnar <mingo@xxxxxxx>

Signed-off-by: Ingo Molnar <mingo@xxxxxxx>
Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
---
arch/x86/kernel/reboot.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)

Index: linux-x86.q/arch/x86/kernel/reboot.c
===================================================================
--- linux-x86.q.orig/arch/x86/kernel/reboot.c
+++ linux-x86.q/arch/x86/kernel/reboot.c
@@ -396,8 +396,20 @@ static void native_machine_shutdown(void
if (!cpu_isset(reboot_cpu_id, cpu_online_map))
reboot_cpu_id = smp_processor_id();

- /* Make certain I only run on the appropriate processor */
- set_cpus_allowed(current, cpumask_of_cpu(reboot_cpu_id));
+ /*
+ * Make certain we only run on the appropriate processor,
+ * and with sufficient priority:
+ */
+ {
+ struct sched_param schedparm;
+ int ret;
+
+ schedparm.sched_priority = 99;
+ ret = sched_setscheduler(current, SCHED_RR, &schedparm);
+ WARN_ON_ONCE(1);
+
+ set_cpus_allowed(current, cpumask_of_cpu(reboot_cpu_id));
+ }

/* O.K Now that I'm on the appropriate processor,
* stop all of the others.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/