Re: [PATCH 0/3] cpu: idle state framework for offline CPUs.

From: Dipankar Sarma
Date: Thu Aug 13 2009 - 00:59:46 EST


On Wed, Aug 12, 2009 at 08:45:18PM -0400, Len Brown wrote:
> On Thu, 13 Aug 2009, Dipankar Sarma wrote:
> > In a native system, I think we should the platform-specific code
> > export what makes sense. That may be just the lowest possible
> > state only. Or may be more than one.
>
> For x86, it is 1 state.

Native x86, yes. For virtualized systems, that may not be the
case depending on how the hypervisor behaves.

> > In a virtualized system, we would want to do at least the following -
>
> Are you talking about Linux as a para-virtualized guest here?
>
> > 1. An offline configuration state where the hypervisor can
> > take the cpu back and allocate it to another VM.
>
> The hypervisor gets control no matter what idle state
> the guest enters, yes?

The hypervisor may get control, but what they do may depend
on that the guest OS wished/hinted for - config change or just
shutdown unused cpu if possible for a while.

> > 2. A low-power state where the guest indicates it doesn't need the
> > CPU (and can be put in low power state) but doesn't want to give up
> > its allocated cpu share. IOW, no visible configuration changes.
> >
> > So, in any case we would probably want more than one states.
>
> How are #1 and #2 different when the hypervisor
> gets control in all idle states? I assert that
> they are the same, and thus 1 state will suffice.

It depends on the hypervisor implementation. On pseries (powerpc)
hypervisor, for example, they are different. By offlining a vcpu
(and in turn shutting a cpu), you will actually create a configuration
change in the VM that is visible to other systems management tools
which may not be what the system administrator wanted. Ideally,
we would like to distinguish between these two states.

Hope that suffices as an example.

Thanks
Dipankar
--
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/