lkml.org 
[lkml]   [2009]   [May]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch 1/2] x86: Add pm_play_dead funcptr to power-efficiently offline CPUs
Add a funcptr pm_play_dead (similar to pm_idle) that can take
the offline CPUs to the most power efficient idle state.

This patch just adds the func pointer. The pointer will get initialized
by patch that follows.

Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
---
arch/x86/include/asm/smp.h | 2 ++
arch/x86/kernel/smpboot.c | 7 ++++++-
2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h
index 19e0d88..0388b81 100644
--- a/arch/x86/include/asm/smp.h
+++ b/arch/x86/include/asm/smp.h
@@ -148,6 +148,8 @@ static inline int num_booting_cpus(void)
{
return cpumask_weight(cpu_callout_mask);
}
+
+extern void (*pm_play_dead)(void);
#endif /* CONFIG_SMP */

extern unsigned disabled_cpus __cpuinitdata;
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 58d24ef..4f8af6a 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -1195,6 +1195,8 @@ __init void prefill_possible_map(void)
nr_cpu_ids = possible;
}

+void (*pm_play_dead)(void) = NULL;
+
#ifdef CONFIG_HOTPLUG_CPU

static void remove_siblinginfo(int cpu)
@@ -1313,7 +1315,10 @@ void play_dead_common(void)
void native_play_dead(void)
{
play_dead_common();
- wbinvd_halt();
+ if (pm_play_dead)
+ pm_play_dead();
+ else
+ wbinvd_halt();
}

#else /* ... !CONFIG_HOTPLUG_CPU */
--
1.6.0.6
--



\
 
 \ /
  Last update: 2009-05-23 01:27    [W:0.205 / U:0.996 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site