summaryrefslogtreecommitdiffstats
path: root/drivers/cpuidle/cpuidle-powernv.c
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2017-06-14 15:02:39 +0200
committerMichael Ellerman <mpe@ellerman.id.au>2017-06-28 05:08:11 +0200
commit3fc5ee927ff4ffed6aa2fcd44d2fbf07ac893cdc (patch)
treef1baf035f55d69d0e3aec789e77ebe2873e78f9e /drivers/cpuidle/cpuidle-powernv.c
parentpowerpc/fadump: add reschedule point while releasing memory (diff)
downloadlinux-3fc5ee927ff4ffed6aa2fcd44d2fbf07ac893cdc.tar.xz
linux-3fc5ee927ff4ffed6aa2fcd44d2fbf07ac893cdc.zip
cpuidle: powerpc: cpuidle set polling before enabling irqs
local_irq_enable can cause interrupts to be taken which could take significant amount of processing time. The idle process should set its polling flag before this, so another process that wakes it during this time will not have to send an IPI. Expand the TIF_POLLING_NRFLAG coverage to as large as possible. Reviewed-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com> Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'drivers/cpuidle/cpuidle-powernv.c')
-rw-r--r--drivers/cpuidle/cpuidle-powernv.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/cpuidle/cpuidle-powernv.c b/drivers/cpuidle/cpuidle-powernv.c
index 79152676f62b..50b3c2e0306f 100644
--- a/drivers/cpuidle/cpuidle-powernv.c
+++ b/drivers/cpuidle/cpuidle-powernv.c
@@ -51,9 +51,10 @@ static int snooze_loop(struct cpuidle_device *dev,
{
u64 snooze_exit_time;
- local_irq_enable();
set_thread_flag(TIF_POLLING_NRFLAG);
+ local_irq_enable();
+
snooze_exit_time = get_tb() + snooze_timeout;
ppc64_runlatch_off();
HMT_very_low();
@@ -66,6 +67,7 @@ static int snooze_loop(struct cpuidle_device *dev,
ppc64_runlatch_on();
clear_thread_flag(TIF_POLLING_NRFLAG);
smp_mb();
+
return index;
}