Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

kernel/sched: Fix util_est accounting for DELAY_DEQUEUE

Remove delayed tasks from util_est even they are runnable.

Exclude delayed task which are (a) migrating between rq's or (b) in a
SAVE/RESTORE dequeue/enqueue.

Signed-off-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/c49ef5fe-a909-43f1-b02f-a765ab9cedbf@arm.com

authored by

Dietmar Eggemann and committed by
Peter Zijlstra
729288bc 6b9ccbc0

+9 -7
+9 -7
kernel/sched/fair.c
··· 6948 6948 int rq_h_nr_running = rq->cfs.h_nr_running; 6949 6949 u64 slice = 0; 6950 6950 6951 - if (flags & ENQUEUE_DELAYED) { 6952 - requeue_delayed_entity(se); 6953 - return; 6954 - } 6955 - 6956 6951 /* 6957 6952 * The code below (indirectly) updates schedutil which looks at 6958 6953 * the cfs_rq utilization to select a frequency. 6959 6954 * Let's add the task's estimated utilization to the cfs_rq's 6960 6955 * estimated utilization, before we update schedutil. 6961 6956 */ 6962 - util_est_enqueue(&rq->cfs, p); 6957 + if (!(p->se.sched_delayed && (task_on_rq_migrating(p) || (flags & ENQUEUE_RESTORE)))) 6958 + util_est_enqueue(&rq->cfs, p); 6959 + 6960 + if (flags & ENQUEUE_DELAYED) { 6961 + requeue_delayed_entity(se); 6962 + return; 6963 + } 6963 6964 6964 6965 /* 6965 6966 * If in_iowait is set, the code below may not trigger any cpufreq ··· 7178 7177 */ 7179 7178 static bool dequeue_task_fair(struct rq *rq, struct task_struct *p, int flags) 7180 7179 { 7181 - util_est_dequeue(&rq->cfs, p); 7180 + if (!(p->se.sched_delayed && (task_on_rq_migrating(p) || (flags & DEQUEUE_SAVE)))) 7181 + util_est_dequeue(&rq->cfs, p); 7182 7182 7183 7183 if (dequeue_entities(rq, &p->se, flags) < 0) { 7184 7184 util_est_update(&rq->cfs, p, DEQUEUE_SLEEP);