summaryrefslogtreecommitdiff
path: root/kernel/sched/idle.c
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2020-07-02 15:51:48 +0200
committerPeter Zijlstra <peterz@infradead.org>2020-07-02 15:51:48 +0200
commit78c2141b654375079e3737f06f19cabfc0fcecd7 (patch)
tree5068a6c2904d93b61b37243ea39b728fe621196e /kernel/sched/idle.c
parentbb42b3d39781d7fcd3be7f9f9bf11b6661b5fdf1 (diff)
parente1ad1ac2deb8f90af9f12ff316989dd5675dec11 (diff)
Merge branch 'perf/vlbr'
Diffstat (limited to 'kernel/sched/idle.c')
-rw-r--r--kernel/sched/idle.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/kernel/sched/idle.c b/kernel/sched/idle.c
index 05deb81bb3e3..1ae95b9150d3 100644
--- a/kernel/sched/idle.c
+++ b/kernel/sched/idle.c
@@ -96,6 +96,15 @@ void __cpuidle default_idle_call(void)
}
}
+static int call_cpuidle_s2idle(struct cpuidle_driver *drv,
+ struct cpuidle_device *dev)
+{
+ if (current_clr_polling_and_test())
+ return -EBUSY;
+
+ return cpuidle_enter_s2idle(drv, dev);
+}
+
static int call_cpuidle(struct cpuidle_driver *drv, struct cpuidle_device *dev,
int next_state)
{
@@ -171,11 +180,9 @@ static void cpuidle_idle_call(void)
if (idle_should_enter_s2idle()) {
rcu_idle_enter();
- entered_state = cpuidle_enter_s2idle(drv, dev);
- if (entered_state > 0) {
- local_irq_enable();
+ entered_state = call_cpuidle_s2idle(drv, dev);
+ if (entered_state > 0)
goto exit_idle;
- }
rcu_idle_exit();