Skip to contentSkip to conversation

generate hotplug events for cpu online

PATCH In review Nathan Lynch 2 participants 3 messages Apr 14, 2005 – Apr 22, 2005 Driver core

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 generate hotplug events for cpu online

We already do kobject_hotplug for cpu offline; this adds a kobject_hotplug call for the online case. This is being requested by developers of an application which wants to be notified about both kinds of events.

drivers/base/cpu.c +2 -0
Index: linux-2.6.12-rc2-mm3/drivers/base/cpu.c
===================================================================
@@ -37,6 +37,8 @@ static ssize_t store_online(struct sys_d
 		break;
 	case '1':
 		ret = cpu_up(cpu->sysdev.id);
+		if (!ret)
+			kobject_hotplug(&dev->kobj, KOBJ_ONLINE);
 		break;
 	default:
 		ret = -EINVAL;
#1 lore raw

Hi!

Quoted 4 lines

We already do kobject_hotplug for cpu offline; this adds a kobject_hotplug call for the online case. This is being requested by developers of an application which wants to be notified about both kinds of events.

I'm afraid of bad interactions with swsusp/S3 on smp. We offline cpus there, but we probably do not want userland to know...

Pavel

Signature · 1 line
64 bytes from 195.113.31.123: icmp_seq=28 ttl=51 time=448769.1 ms         
#2 lore raw
Quoted 9 lines · Pavel Machek

Hi!

Quoted 4 lines

We already do kobject_hotplug for cpu offline; this adds a kobject_hotplug call for the online case. This is being requested by developers of an application which wants to be notified about both kinds of events.

I'm afraid of bad interactions with swsusp/S3 on smp. We offline cpus there, but we probably do not want userland to know...

The kobject_hotplug calls for cpu online and offline are present only in the code paths where the operation is initiated through the sysfs interface, so I don't think you have to worry.

Nathan