sched: restrict iowait boost to tasks with prefer_idle

Currently iowait doesn't distinguish background/foreground tasks and we
have seen cases where a device run to high frequency unnecessarily when
running some background I/O. This patch limits iowait boost to tasks with
prefer_idle only. Specifically, on Pixel, those are foreground and top
app tasks.

Bug: 130308826
Test: Boot and trace
Change-Id: I2d892beeb4b12b7e8f0fb2848c23982148648a10
Signed-off-by: Wei Wang <wvw@google.com>
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
fourteen
Wei Wang 5 years ago committed by Jenna
parent 385215579f
commit e9a8ce9047
  1. 2
      kernel/sched/fair.c

@ -5311,7 +5311,7 @@ enqueue_task_fair(struct rq *rq, struct task_struct *p, int flags)
* utilization updates, so do it here explicitly with the IOWAIT flag
* passed.
*/
if (p->in_iowait)
if (p->in_iowait && prefer_idle)
cpufreq_update_util(rq, SCHED_CPUFREQ_IOWAIT);
for_each_sched_entity(se) {

Loading…
Cancel
Save