Skip to contentSkip to conversation

CPU hotplug /sys entries are missing on 2.6.28

DISCUSSION Giuliano Pochini 1 participant 3 messages Feb 18, 2009 – Feb 22, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

/sys/devices/system/cpu/cpu*/online don't exist anymore.

When the kernel is booted with maxcpus=1 /sys/devices/system/cpu/cpu1 is also missing:

$ ls -la /sys/devices/system/cpu/
totale 0
drwxr-xr-x 3 root root    0  9 feb 23:15 .
drwxr-xr-x 7 root root    0  9 feb 23:15 ..
drwxr-xr-x 4 root root    0  9 feb 23:15 cpu0
-r--r--r-- 1 root root 4096  9 feb 23:15 online
-r--r--r-- 1 root root 4096  9 feb 23:15 possible
-r--r--r-- 1 root root 4096  9 feb 23:15 present
$ cat /sys/devices/system/cpu/online
0
$ cat /sys/devices/system/cpu/possible
0-1
$ cat /sys/devices/system/cpu/present
0-1
$ uname -a
Linux Jay 2.6.28 #1 SMP Sun Jan 11 22:42:31 CET 2009 ppc 7455, altivec supported PowerMac3,6 GNU/Linux

Looking at the 2.6.28 diff, i noticed there is a patch to setup_32.c::ppc_init() that removes the following:

	for_each_possible_cpu(cpu) {
		struct cpu *c = &per_cpu(cpu_devices, cpu);
		c->hotpluggable = 1;
		register_cpu(c, cpu);
	}

Reverting it makes the kernel hang at boot.
The only other place where ->hotpluggable is set is in sysfs.c::topology_init(), but it only happens if ppc_md.cpu_die!=NULL and I couldn't find where that pointer is set. Any clue ?
TIA,

--
Giuliano.

#1 lore raw

Re: CPU hotplug /sys entries are missing on 2.6.28 [PATCH]

Quoted 1 line · On Wed, 18 Feb 2009 22:18:21 +0100 Giuliano Pochini <[email protected]> wrote:

/sys/devices/system/cpu/cpu*/online don't exist anymore.

I think I found the bug. Is this patch ok ?

arch/powerpc/platforms/powermac/setup.c renamed from arch/powerpc/platforms/powermac/setup.c__orig +3 -0
@@ -746,4 +746,7 @@ define_machine(powermac) {
 #if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PPC64)
 	.cpu_die		= pmac_cpu_die,
 #endif
+#if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PPC32)
+	.cpu_die		= generic_mach_cpu_die,
+#endif
 };

--
Giuliano.

#2 lore raw

Re: CPU hotplug /sys entries are missing on 2.6.28 [PATCH]

In reply to Giuliano Pochini
Quoted 1 line · On Wed, 18 Feb 2009 22:18:21 +0100 Giuliano Pochini <[email protected]> wrote:

/sys/devices/system/cpu/cpu*/online don't exist anymore.

I think I found the bug. Is this patch ok ?

arch/powerpc/platforms/powermac/setup.c renamed from arch/powerpc/platforms/powermac/setup.c__orig +3 -0
@@ -746,4 +746,7 @@ define_machine(powermac) {
 #if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PPC64)
 	.cpu_die		= pmac_cpu_die,
 #endif
+#if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PPC32)
+	.cpu_die		= generic_mach_cpu_die,
+#endif
 };

--
Giuliano.