Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d8c391a5593aca5bea002bcaaec16c7bbd6ec853
Commit:     d8c391a5593aca5bea002bcaaec16c7bbd6ec853
Parent:     2f97cd3912428f5044fa7715293a69349fc455fa
Author:     Jake Moilanen <[EMAIL PROTECTED]>
AuthorDate: Fri Jun 8 07:27:11 2007 +1000
Committer:  Paul Mackerras <[EMAIL PROTECTED]>
CommitDate: Thu Jun 14 22:29:58 2007 +1000

    [POWERPC] Donate idle CPU cycles on dedicated partitions
    
    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 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
    have the donate bit set in the VPA.  Then call H_CEDE.
    
    The reason why shared processors just aren't used is because dedicated
    CPUs are guaranteed an actual processor, yet the system is still able to
    increase the capacity of the shared CPU pool.
    
    Also rename the VPA's cpuctls_task_attrs field to a more accurate name.
    
    Signed-off-by: Jake Moilanen <[EMAIL PROTECTED]>
    Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]>
---
 arch/powerpc/kernel/prom_init.c        |    4 +++-
 arch/powerpc/platforms/pseries/setup.c |    2 ++
 include/asm-powerpc/lppaca.h           |    2 +-
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index d6047c4..a1d582e 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -635,6 +635,7 @@ static void __init early_cmdline_parse(void)
 /* ibm,dynamic-reconfiguration-memory property supported */
 #define OV5_DRCONF_MEMORY      0x20
 #define OV5_LARGE_PAGES                0x10    /* large pages supported */
+#define OV5_DONATE_DEDICATE_CPU 0x02   /* donate dedicated CPU support */
 /* PCIe/MSI support.  Without MSI full PCIe is not supported */
 #ifdef CONFIG_PCI_MSI
 #define OV5_MSI                        0x01    /* PCIe/MSI support */
@@ -685,7 +686,8 @@ static unsigned char ibm_architecture_vec[] = {
        /* option vector 5: PAPR/OF options */
        3 - 2,                          /* length */
        0,                              /* don't ignore, don't halt */
-       OV5_LPAR | OV5_SPLPAR | OV5_LARGE_PAGES | OV5_DRCONF_MEMORY | OV5_MSI,
+       OV5_LPAR | OV5_SPLPAR | OV5_LARGE_PAGES | OV5_DRCONF_MEMORY |
+       OV5_DONATE_DEDICATE_CPU | OV5_MSI,
 };
 
 /* Old method - ELF header with PT_NOTE sections */
diff --git a/arch/powerpc/platforms/pseries/setup.c 
b/arch/powerpc/platforms/pseries/setup.c
index 470db6e..de6c2ef 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -399,6 +399,7 @@ static void pseries_dedicated_idle_sleep(void)
         * a good time to find other work to dispatch.
         */
        get_lppaca()->idle = 1;
+       get_lppaca()->donate_dedicated_cpu = 1;
 
        /*
         * We come in with interrupts disabled, and need_resched()
@@ -431,6 +432,7 @@ static void pseries_dedicated_idle_sleep(void)
 
 out:
        HMT_medium();
+       get_lppaca()->donate_dedicated_cpu = 0;
        get_lppaca()->idle = 0;
 }
 
diff --git a/include/asm-powerpc/lppaca.h b/include/asm-powerpc/lppaca.h
index 821ea0c..567ed92 100644
--- a/include/asm-powerpc/lppaca.h
+++ b/include/asm-powerpc/lppaca.h
@@ -98,7 +98,7 @@ struct lppaca {
        u64     saved_gpr5;             // Saved GPR5                   x30-x37
 
        u8      reserved4;              // Reserved                     x38-x38
-       u8      cpuctls_task_attrs;     // Task attributes for cpuctls  x39-x39
+       u8      donate_dedicated_cpu;   // Donate dedicated CPU cycles  x39-x39
        u8      fpregs_in_use;          // FP regs in use               x3A-x3A
        u8      pmcregs_in_use;         // PMC regs in use              x3B-x3B
        volatile u32 saved_decr;        // Saved Decr Value             x3C-x3F
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to