From 60906c0717e196451234251126a25ca0740ce24c Mon Sep 17 00:00:00 2001 From: Deepthi Dharwar Date: Wed, 3 Oct 2012 18:42:26 +0000 Subject: [PATCH] --- yaml --- r: 334481 b: refs/heads/master c: 83dac59409387789b88bed40b1be86a8abc572be h: refs/heads/master i: 334479: 595efca581f2d6c9ae97de73604b26a0dcbeeae7 v: v3 --- [refs] | 2 +- .../platforms/pseries/processor_idle.c | 36 +++++++------------ 2 files changed, 14 insertions(+), 24 deletions(-) diff --git a/[refs] b/[refs] index 4ef29c31a931..efaac192b4f0 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 8ea959a17fe6e27f7954dddad5b17b0e33f0d7ee +refs/heads/master: 83dac59409387789b88bed40b1be86a8abc572be diff --git a/trunk/arch/powerpc/platforms/pseries/processor_idle.c b/trunk/arch/powerpc/platforms/pseries/processor_idle.c index a32d56d1f854..45d00e5fe14d 100644 --- a/trunk/arch/powerpc/platforms/pseries/processor_idle.c +++ b/trunk/arch/powerpc/platforms/pseries/processor_idle.c @@ -59,32 +59,22 @@ static int snooze_loop(struct cpuidle_device *dev, { unsigned long in_purr; ktime_t kt_before; - unsigned long start_snooze; - long snooze = drv->states[0].target_residency; + int cpu = dev->cpu; idle_loop_prolog(&in_purr, &kt_before); + local_irq_enable(); + set_thread_flag(TIF_POLLING_NRFLAG); - if (snooze) { - start_snooze = get_tb() + snooze * tb_ticks_per_usec; - local_irq_enable(); - set_thread_flag(TIF_POLLING_NRFLAG); - - while ((snooze < 0) || (get_tb() < start_snooze)) { - if (need_resched() || cpu_is_offline(dev->cpu)) - goto out; - ppc64_runlatch_off(); - HMT_low(); - HMT_very_low(); - } - - HMT_medium(); - clear_thread_flag(TIF_POLLING_NRFLAG); - smp_mb(); - local_irq_disable(); + while ((!need_resched()) && cpu_online(cpu)) { + ppc64_runlatch_off(); + HMT_low(); + HMT_very_low(); } -out: HMT_medium(); + clear_thread_flag(TIF_POLLING_NRFLAG); + smp_mb(); + dev->last_residency = (int)idle_loop_epilog(in_purr, kt_before); return index; @@ -165,8 +155,8 @@ static struct cpuidle_state dedicated_states[MAX_IDLE_STATE_COUNT] = { .name = "CEDE", .desc = "CEDE", .flags = CPUIDLE_FLAG_TIME_VALID, - .exit_latency = 1, - .target_residency = 10, + .exit_latency = 10, + .target_residency = 100, .enter = &dedicated_cede_loop }, }; @@ -197,7 +187,7 @@ void update_smt_snooze_delay(int cpu, int residency) dev->states_usage[1].disable = 1; } else if (drv) - drv->states[0].target_residency = residency; + drv->states[1].target_residency = residency; } static int pseries_cpuidle_add_cpu_notifier(struct notifier_block *n,