Skip to content

Commit 6400cd3

Browse files
weivincewangDhineshCool
authored andcommitted
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: Lau <laststandrighthere@gmail.com>
1 parent b5c22ba commit 6400cd3

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

kernel/sched/fair.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4948,6 +4948,7 @@ enqueue_task_fair(struct rq *rq, struct task_struct *p, int flags)
49484948
#ifdef CONFIG_SMP
49494949
int task_new = flags & ENQUEUE_WAKEUP_NEW;
49504950
#endif
4951+
bool prefer_idle = schedtune_prefer_idle(p) > 0;
49514952

49524953
#ifdef CONFIG_SCHED_WALT
49534954
p->misfit = !task_fits_max(p, rq->cpu);
@@ -4957,7 +4958,7 @@ enqueue_task_fair(struct rq *rq, struct task_struct *p, int flags)
49574958
* utilization updates, so do it here explicitly with the IOWAIT flag
49584959
* passed.
49594960
*/
4960-
if (p->in_iowait)
4961+
if (p->in_iowait && prefer_idle)
49614962
cpufreq_update_this_cpu(rq, SCHED_CPUFREQ_IOWAIT);
49624963

49634964
for_each_sched_entity(se) {

0 commit comments

Comments
 (0)