[PATCH 2/2] sched/fair: completely remove update_cfs_group() from enqueue path

From: Aaron Lu
Date: Wed Jul 19 2023 - 03:36:24 EST


---
kernel/sched/fair.c | 3 ---
1 file changed, 3 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index a21ab72819ce..8fc325112282 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4847,8 +4847,6 @@ enqueue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags)
*/
update_load_avg(cfs_rq, se, UPDATE_TG | DO_ATTACH);
se_update_runnable(se);
- if (cfs_rq->nr_running > 0)
- update_cfs_group(se);
account_entity_enqueue(cfs_rq, se);

if (flags & ENQUEUE_WAKEUP)
@@ -6344,7 +6342,6 @@ enqueue_task_fair(struct rq *rq, struct task_struct *p, int flags)

update_load_avg(cfs_rq, se, UPDATE_TG);
se_update_runnable(se);
- update_cfs_group(se);

cfs_rq->h_nr_running++;
cfs_rq->idle_h_nr_running += idle_h_nr_running;
--
2.40.1

Then P50's latency will bump to ~4ms from ~20us:
Latency percentiles (usec) runtime 300 (s) (17940 total samples)
50.0th: 3996 (12092 samples)
75.0th: 4004 (4919 samples)
90.0th: 4004 (0 samples)
95.0th: 4012 (353 samples)
*99.0th: 20000 (487 samples)
99.5th: 20000 (0 samples)
99.9th: 31136 (72 samples)
min=7, max=37402
real 5m36.633s
user 47m33.947s
sys 4m47.097s

So for the read side, maybe just keep what patch4 does?

Thanks,
Aaron