Skip to contentSkip to conversation

Node Hotplug Support

PATCH Andi Kleen 4 participants 5 messages May 7, 2004 – May 13, 2004 2 messages not in the archive ACPI

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Andi Kleen

author
#1 lore raw

Keiichiro Tokunaga <[email protected]> writes:

Hallo,

Quoted 4 lines

Where, "node" is a container device that contains CPU, memory, and/or I/O devices. The definition of "node" is different from one of "NUMA node".

This does not really fit well into the Linux/Unix philosophy to do one thing with one mechanism and do it well, and keep policy in user space.

Better would be to do individual mechanisms to hot plug these various things; and if you feel the need to combine them e.g. for administrative purposes do this in user space.

Quoted 6 lines

Why?
====
Someone might think like "Why don't we invoke CPU, memory, IO hotplug individually without node hotplug?". However, CPU, memory, and IO hotplug cannot remove a node (container device) from the system physically. That's a node hotplug's job. Also,

You can remove them physically as soon as all the hardware in it is removed. There can be many more things than you listed anyways on such a "node"; lprocesses which are bound to the CPU of the node (which need to be killed) or device drivers bound to slots on the node (which need to be shutdown). I do not think it makes much sense to attempt to combine all these at kernel level; that is more a job for a shell script. The bad experience with the current sysfs power management hierarchy shows that the kernel is a poor place to attempt this.

Quoted 7 lines

when hotplug request occurs on a node, node hotplug searchs resouces on the node, and invokes CPU, memory, and IO hotplug
in proper order. Actually, the order is very important. For instance,
when hot-adding a NUMA node, memory should be added first so that CPUs could allocate data in the memory while the CPUs is being added. Otherwise, CPUs need to allocate it in other memory on other node. This might cause performance issue.

This order can be also easily done in user space.

This has the advantage that if there is some reason to add CPUs without memory (or memory without CPUs or PCI slots without anything) it will just work too. It is not clear that your "lump everything mechanism into one" can handle all that. Most likely you would need to add lots of special cases to it to handle all this. Separate mechanisms can do this cleaner.

Admittedly there would still need to be some coordination in case you would want to remove a whole building block of your machine like you said. An nice way to do this would be to add an atomic "to be removed" state to the individual unregister mechanisms that prevents the device from being reregistered until removed.

Quoted 3 lines

Design
======
ACPI is used to do some hardware manipulation.

That will not work as a portable mechanism. Most linux ports including some that support NUMA and hotplug do not have ACPI.

Rather you could do an layer to do this which is implemented in the architecture. Then all ACPi supporting architectures could use a common implementation and the other architectures their own. The design of this layer would need some discussion first to make sure it does not have too many assumptions from your system that would not hold on others.

-Andi

#2 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 5 lines · Andi Kleen

Admittedly there would still need to be some coordination in case you would want to remove a whole building block of your machine like you said. An nice way to do this would be to add an atomic "to be removed" state to the individual unregister mechanisms that prevents the device from being reregistered until removed.

This is also needed for "to be replaced" state.
Imagine a node with b0rken CPU, where you still like to use its memory.

Both states can be the same actually ;-)

Regards

Ingo Oeser

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAnSA1U56oYWuOrkARAnjYAJ9CfcVGC9GnqlmvSpwRzI10jj7WGwCguKYq qtawhKJiy/j8r0d3qfqBrSw=
=Z+oX
-----END PGP SIGNATURE-----

#3 lore raw
In reply to Andi Kleen
Quoted 10 lines · On Fri, 07 May 2004 21:10:58 +0200 Andi Kleen <[email protected]> wrote:

Keiichiro Tokunaga <[email protected]> writes:

Hallo,

Quoted 4 lines

Where, "node" is a container device that contains CPU, memory, and/or I/O devices. The definition of "node" is different from one of "NUMA node".

This does not really fit well into the Linux/Unix philosophy to do one thing with one mechanism and do it well, and keep policy in user space.

Policy could be moved in user space as you mentioned.

Quoted 3 lines

Better would be to do individual mechanisms to hot plug these various things; and if you feel the need to combine them e.g. for administrative purposes do this in user space.

"node hotplug" of LHNS is not just a controller to invoke CPU, memory, IO hotplug with a policy. It does hotplug a container device also. When a container device is attached to the system, it should be detected by someone. Node hotplug (kernel) can do it.

Quoted 7 lines
Quoted 6 lines

Why?
====
Someone might think like "Why don't we invoke CPU, memory, IO hotplug individually without node hotplug?". However, CPU, memory, and IO hotplug cannot remove a node (container device) from the system physically. That's a node hotplug's job. Also,

Quoted 9 lines

You can remove them physically as soon as all the hardware in it is removed. There can be many more things than you listed anyways on such a "node"; lprocesses which are bound to the CPU of the node (which need to be killed) or device drivers bound to slots on the node (which need to be shutdown). I do not think it makes much sense to attempt to combine all these at kernel level; that is more a job for a shell script. The bad experience with the current sysfs power management hierarchy shows that the kernel is a poor place to attempt this.

As you mentioned, there can be many more things. However, the examples you showed should be handled by individual hotplug. For instance, the processes bound to a certain CPU should be handled by CPU hotplug when node hotplug invokes CPU hotplug. Also, the device drivers bound to slots should be detached by IO hotplug. Node hotplug is supposed to take care of a container device and just invoke individual hotplugs for other devices. Node hotplug doesn't break any policy of each hotplug (CPU, memory, IO, etc).

Shell script could handle hot-removal of container hotplug, but detecting an added container device needs to be done in kernel level.

Quoted 9 lines
Quoted 7 lines

when hotplug request occurs on a node, node hotplug searchs resouces on the node, and invokes CPU, memory, and IO hotplug
in proper order. Actually, the order is very important. For instance,
when hot-adding a NUMA node, memory should be added first so that CPUs could allocate data in the memory while the CPUs is being added. Otherwise, CPUs need to allocate it in other memory on other node. This might cause performance issue.

This order can be also easily done in user space.

Yes.

Quoted 7 lines

This has the advantage that if there is some reason to add CPUs without memory (or memory without CPUs or PCI slots without anything) it will just work too. It is not clear that your "lump everything mechanism into one" can handle all that. Most likely you would need to add lots of special cases to it to handle all this. Separate mechanisms can do this cleaner.

Yes. The cases (combination of hardware) would increase. However, I don't think there would be that many today.

Quoted 5 lines

Admittedly there would still need to be some coordination in case you would want to remove a whole building block of your machine like you said. An nice way to do this would be to add an atomic "to be removed" state to the individual unregister mechanisms that prevents the device from being reregistered until removed.

I agree. Actually, I already prepare the "to be removed" state in node hotplug, it's not used yet though:) It's also necessary for individual hotplug as you mentioned.

Quoted 7 lines
Quoted 3 lines

Design
======
ACPI is used to do some hardware manipulation.

That will not work as a portable mechanism. Most linux ports including some that support NUMA and hotplug do not have ACPI.

Quoted 6 lines

Rather you could do an layer to do this which is implemented in the architecture. Then all ACPi supporting architectures could use a common implementation and the other architectures their own. The design of this layer would need some discussion first to make sure it does not have too many assumptions from your system that would not hold on others.

Are you saying here that platform-independent and dependent codes should be separated so that the independent part could be implemented by any other platform (firmware) in their own style? If so, I agree and some discussion are necessary :)

Thanks,
Kei

author
#4 lore raw
Quoted 9 lines · Keiichiro Tokunaga

As you mentioned, there can be many more things. However, the examples you showed should be handled by individual hotplug. For instance, the processes bound to a certain CPU should be handled by CPU hotplug when node hotplug invokes CPU hotplug. Also, the device drivers bound to slots should be detached by IO hotplug. Node hotplug is supposed to take care of a container device and just invoke individual hotplugs for other devices. Node hotplug doesn't break any policy of each hotplug (CPU, memory, IO, etc).

To coordinate all them you need user space infrastructure anyways that knows about all the elements of a node. I don't see why you want a kernel level container too; userspace can do this job already and would be much more flexible.

Quoted 10 lines
Quoted 7 lines

This has the advantage that if there is some reason to add CPUs without memory (or memory without CPUs or PCI slots without anything) it will just work too. It is not clear that your "lump everything mechanism into one" can handle all that. Most likely you would need to add lots of special cases to it to handle all this. Separate mechanisms can do this cleaner.

Yes. The cases (combination of hardware) would increase. However, I don't think there would be that many today.

I am mainly thinking about virtualization here for which hotplug of everything makes definitely sense. But the requirements could be very different from what a big iron machine wants.

Quoted 4 lines

Are you saying here that platform-independent and dependent codes should be separated so that the independent part could be implemented by any other platform (firmware) in their own style? If so, I agree and some discussion are necessary :)

Yep.

-Andi

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw
Quoted 11 lines · On Mon, 10 May 2004 21:54:39 +0200 Andi Kleen…
Quoted 9 lines · Keiichiro Tokunaga

As you mentioned, there can be many more things. However, the examples you showed should be handled by individual hotplug. For instance, the processes bound to a certain CPU should be handled by CPU hotplug when node hotplug invokes CPU hotplug. Also, the device drivers bound to slots should be detached by IO hotplug. Node hotplug is supposed to take care of a container device and just invoke individual hotplugs for other devices. Node hotplug doesn't break any policy of each hotplug (CPU, memory, IO, etc).

Quoted 4 lines

To coordinate all them you need user space infrastructure anyways that knows about all the elements of a node. I don't see why you want a kernel level container too; userspace can do this job already and would be much more flexible.

Are you saying that LHNS should handle only container device, and CPU, memory, IO devices on the container device should be handled by each hotplug? Also, each hotplug and LHNS should be invoked from user space individually? For instance:

To hot-remove a container device, an operator:
1. Invokes memory hotplug (memory will be gone)
2. Invokes CPU hotplug (CPUs will be gone)
3. Invokes IO hotplug (IO devices will be gone)
4. Invokes node(container) hotplug (Conainer devices will be gone)

Is that what you're saying here?

Quoted 8 lines
Quoted 8 lines
Quoted 7 lines

This has the advantage that if there is some reason to add CPUs without memory (or memory without CPUs or PCI slots without anything) it will just work too. It is not clear that your "lump everything mechanism into one" can handle all that. Most likely you would need to add lots of special cases to it to handle all this. Separate mechanisms can do this cleaner.

Quoted 6 lines
Quoted 2 lines

Yes. The cases (combination of hardware) would increase. However, I don't think there would be that many today.

I am mainly thinking about virtualization here for which hotplug of everything makes definitely sense. But the requirements could be very different from what a big iron machine wants.

I'm afraid but I don't get the point here. Could you explain that again?

Quoted 8 lines
Quoted 4 lines

Are you saying here that platform-independent and dependent codes should be separated so that the independent part could be implemented by any other platform (firmware) in their own style? If so, I agree and some discussion are necessary :)

Yep.

-Andi

Rajesh Shah coordinated me to more apropreate place to discuss this topic since LHNS is focusing on extenting ACPI based hotplug. So I'm moving this discussion to acpi-devel list and away from LKML.

Thanks,
Kei

-------------------------------------------------------
This SF.Net email is sponsored by: SourceForge.net Broadband Sign-up now for SourceForge Broadband and get the fastest 6.0/768 connection for only $19.95/mo for the first 3 months!
http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click