diff options
-rw-r--r-- | drivers/acpi/acpi_pad.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/acpi/acpi_pad.c b/drivers/acpi/acpi_pad.c index 37d73024b82e..e20708f2b8e5 100644 --- a/drivers/acpi/acpi_pad.c +++ b/drivers/acpi/acpi_pad.c | |||
@@ -215,8 +215,15 @@ static int power_saving_thread(void *data) | |||
215 | * borrow CPU time from this CPU and cause RT task use > 95% | 215 | * borrow CPU time from this CPU and cause RT task use > 95% |
216 | * CPU time. To make 'avoid starvation' work, takes a nap here. | 216 | * CPU time. To make 'avoid starvation' work, takes a nap here. |
217 | */ | 217 | */ |
218 | if (do_sleep) | 218 | if (unlikely(do_sleep)) |
219 | schedule_timeout_killable(HZ * idle_pct / 100); | 219 | schedule_timeout_killable(HZ * idle_pct / 100); |
220 | |||
221 | /* If an external event has set the need_resched flag, then | ||
222 | * we need to deal with it, or this loop will continue to | ||
223 | * spin without calling __mwait(). | ||
224 | */ | ||
225 | if (unlikely(need_resched())) | ||
226 | schedule(); | ||
220 | } | 227 | } |
221 | 228 | ||
222 | exit_round_robin(tsk_index); | 229 | exit_round_robin(tsk_index); |