Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 140561
b: refs/heads/master
c: 30e1e6d
h: refs/heads/master
i:
  140559: bbddc4d
v: v3
  • Loading branch information
Rusty Russell authored and Ingo Molnar committed Mar 18, 2009
1 parent 860b7b1 commit d958699
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 082edb7bf443eb8eda15b482d16ad9dd8137ad24
refs/heads/master: 30e1e6d1af2b67558bccf322af2b3e0676b209ae
1 change: 1 addition & 0 deletions trunk/arch/x86/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,7 @@ static inline void __sti_mwait(unsigned long eax, unsigned long ecx)
extern void mwait_idle_with_hints(unsigned long eax, unsigned long ecx);

extern void select_idle_routine(const struct cpuinfo_x86 *c);
extern void init_c1e_mask(void);

extern unsigned long boot_option_idle_override;
extern unsigned long idle_halt;
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/x86/kernel/cpu/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,7 @@ static void vgetcpu_set_mode(void)
void __init identify_boot_cpu(void)
{
identify_cpu(&boot_cpu_data);
init_c1e_mask();
#ifdef CONFIG_X86_32
sysenter_setup();
enable_sep_cpu();
Expand Down
14 changes: 11 additions & 3 deletions trunk/arch/x86/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,8 @@ static int c1e_detected;

void c1e_remove_cpu(int cpu)
{
cpumask_clear_cpu(cpu, c1e_mask);
if (c1e_mask != NULL)
cpumask_clear_cpu(cpu, c1e_mask);
}

/*
Expand Down Expand Up @@ -556,13 +557,20 @@ void __cpuinit select_idle_routine(const struct cpuinfo_x86 *c)
pm_idle = mwait_idle;
} else if (check_c1e_idle(c)) {
printk(KERN_INFO "using C1E aware idle routine\n");
alloc_cpumask_var(&c1e_mask, GFP_KERNEL);
cpumask_clear(c1e_mask);
pm_idle = c1e_idle;
} else
pm_idle = default_idle;
}

void __init init_c1e_mask(void)
{
/* If we're using c1e_idle, we need to allocate c1e_mask. */
if (pm_idle == c1e_idle) {
alloc_cpumask_var(&c1e_mask, GFP_KERNEL);
cpumask_clear(c1e_mask);
}
}

static int __init idle_setup(char *str)
{
if (!str)
Expand Down

0 comments on commit d958699

Please sign in to comment.