Thread (6 messages) 6 messages, 3 authors, 2007-06-07

Re: [PATCH] Donate dedicated CPU cycles

From: Olof Johansson <hidden>
Date: 2007-05-31 20:09:15

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.
[...]
quoted hunk ↗ jump to hunk
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help