Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 99426
b: refs/heads/master
c: 6ddd2a2
h: refs/heads/master
v: v3
  • Loading branch information
Thomas Gleixner authored and Ingo Molnar committed Jun 10, 2008
1 parent 6f608fd commit 3913f7f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 23 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: 9e26d84273541a8c6c2efb705457ca8e6245fb73
refs/heads/master: 6ddd2a27948f0bd02a2ad001e8a6816898eba0dc
18 changes: 7 additions & 11 deletions trunk/arch/x86/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,27 +139,23 @@ static int __cpuinit mwait_usable(const struct cpuinfo_x86 *c)

void __cpuinit select_idle_routine(const struct cpuinfo_x86 *c)
{
static int selected;

if (selected)
return;
#ifdef CONFIG_X86_SMP
if (pm_idle == poll_idle && smp_num_siblings > 1) {
printk(KERN_WARNING "WARNING: polling idle and HT enabled,"
" performance may degrade.\n");
}
#endif
if (pm_idle)
return;

if (cpu_has(c, X86_FEATURE_MWAIT) && mwait_usable(c)) {
/*
* Skip, if setup has overridden idle.
* One CPU supports mwait => All CPUs supports mwait
*/
if (!pm_idle) {
printk(KERN_INFO "using mwait in idle threads.\n");
pm_idle = mwait_idle;
}
}
selected = 1;
printk(KERN_INFO "using mwait in idle threads.\n");
pm_idle = mwait_idle;
} else
pm_idle = default_idle;
}

static int __init idle_setup(char *str)
Expand Down
7 changes: 1 addition & 6 deletions trunk/arch/x86/kernel/process_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,24 +168,19 @@ void cpu_idle(void)
while (1) {
tick_nohz_stop_sched_tick();
while (!need_resched()) {
void (*idle)(void);

check_pgt_cache();
rmb();
idle = pm_idle;

if (rcu_pending(cpu))
rcu_check_callbacks(cpu, 0);

if (!idle)
idle = default_idle;

if (cpu_is_offline(cpu))
play_dead();

local_irq_disable();
__get_cpu_var(irq_stat).idle_timestamp = jiffies;
idle();
pm_idle();
}
tick_nohz_restart_sched_tick();
preempt_enable_no_resched();
Expand Down
7 changes: 2 additions & 5 deletions trunk/arch/x86/kernel/process_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,9 @@ void cpu_idle(void)
while (1) {
tick_nohz_stop_sched_tick();
while (!need_resched()) {
void (*idle)(void);

rmb();
idle = pm_idle;
if (!idle)
idle = default_idle;

if (cpu_is_offline(smp_processor_id()))
play_dead();
/*
Expand All @@ -165,7 +162,7 @@ void cpu_idle(void)
*/
local_irq_disable();
enter_idle();
idle();
pm_idle();
/* In many cases the interrupt that ended idle
has already called exit_idle. But some idle
loops can be woken up without interrupt. */
Expand Down

0 comments on commit 3913f7f

Please sign in to comment.