[PATCH] Donate dedicated CPU cycles
Olof Johansson
olof at lixom.net
Fri Jun 1 06:14:48 EST 2007
Hi,
On Thu, May 31, 2007 at 02:14:45PM -0500, Jake Moilanen wrote:
> A Power6 can give up CPU cycles on a dedicated CPU (as opposed to a
> shared CPU) to other shared processors if the administrator asks for it
> (via the HMC).
>
> This patch enables that to work properly on P6.
>
> This just involves setting a bit in the CAS structure as well as the
> VPA. To donate cycles, a CPU has to have all SMT threads idle and w/
> donate bit set in the VPA. Then call H_CEDE.
[...]
> Index: powerpc/arch/powerpc/platforms/pseries/setup.c
> ===================================================================
> --- powerpc.orig/arch/powerpc/platforms/pseries/setup.c
> +++ powerpc/arch/powerpc/platforms/pseries/setup.c
> @@ -399,6 +399,7 @@ static void pseries_dedicated_idle_sleep
> * a good time to find other work to dispatch.
> */
> get_lppaca()->idle = 1;
> + get_lppaca()->cpuctls_task_attrs = 1;
>
> /*
> * We come in with interrupts disabled, and need_resched()
> @@ -431,6 +432,7 @@ static void pseries_dedicated_idle_sleep
>
> out:
> HMT_medium();
> + get_lppaca()->cpuctls_task_attrs = 0;
> get_lppaca()->idle = 0;
> }
Is this really the cpu controls task attribute field any more? If this
is not just a flag (stored in a byte), the variable should be renamed
accordingly. If it is truly an attribute bitfield, then the attributes
should be named and constants used instead.
-Olof
More information about the Linuxppc-dev
mailing list