Re: [RFD PATCH 0/4] cpu: Bulk CPU Hotplug support.

From: Balbir Singh
Date: Wed Jun 17 2009 - 03:40:51 EST


* Peter Zijlstra <a.p.zijlstra@xxxxxxxxx> [2009-06-17 09:32:57]:

> On Tue, 2009-06-16 at 13:37 +0530, Vaidyanathan Srinivasan wrote:
> > * Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> [2009-06-15 23:23:18]:
> >
> > > On Tue, 16 Jun 2009 11:08:39 +0530 Gautham R Shenoy <ego@xxxxxxxxxx> wrote:
> > >
> > > > Currently on a ppc64 box with 16 CPUs, the time taken for
> > > > a individual cpu-hotplug operation is as follows.
> > > >
> > > > # time echo 0 > /sys/devices/system/cpu/cpu2/online
> > > > real 0m0.025s
> > > > user 0m0.000s
> > > > sys 0m0.002s
> > > >
> > > > # time echo 1 > /sys/devices/system/cpu/cpu2/online
> > > > real 0m0.021s
> > > > user 0m0.000s
> > > > sys 0m0.000s
> > >
> > > Surprised. Do people really online and offline CPUs frequently enough
> > > for this to be a problem?
> >
> > Certainly not for hardware faults or hardware replacement, but
> > cpu-hotplug interface is useful for changing system configuration to
> > meet different objectives like
> >
> > * Reduce system capacity to reduce average power and reduce heat
> >
> > * Increasing number of cores and threads in a CPU package is leading
> > to multiple cpu offline/online operations for any perceivable effect
> >
> > * Dynamically change CPU configurations in virtualized environments
>
> I tend to agree with Andrew, if any of those things are done frequent
> enough that the hotplug performance matter you're doing something mighty
> odd.
>

Peter, what Vaidy mentioned are very useful cases, to add to that

Consider for example the need to turn of all threads belonging to a
package or the system. I can basically give out the cpu ids of all
threads and hotplug them out at once depending on the workload. In
effect turning off hyper-threading on the package.

Doing it all together provides benefits of (not complete, but
better control) over rollback apart from the speed benefit.

The benefit mentioned by Paul of speed up is very useful as well on
large systems and on the boot up time of virtual machines as well.


--
Balbir
--
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/