Commit dfcfc97
sched/fair: Co-locate cfs_rq and sched_entity in cfs_tg_state
Improve data locality and reduce pointer chasing by allocating struct
cfs_rq and struct sched_entity together for non-root task groups. This
is achieved by introducing a new combined struct cfs_tg_state that
holds both objects in a single allocation.
This patch:
- Introduces struct cfs_tg_state that embeds cfs_rq, sched_entity, and
sched_statistics together in a single structure.
- Updates __schedstats_from_se() in stats.h to use cfs_tg_state for accessing
sched_statistics from a group sched_entity.
- Modifies alloc_fair_sched_group() and free_fair_sched_group() to allocate
and free the new struct as a single unit.
- Modifies the per-CPU pointers in task_group->se and task_group->cfs_rq to
point to the members in the new combined structure.
Signed-off-by: Zecheng Li <zecheng@google.com>
Signed-off-by: Zecheng Li <zli94@ncsu.edu>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: K Prateek Nayak <kprateek.nayak@amd.com>
Reviewed-by: Josh Don <joshdon@google.com>
Link: https://patch.msgid.link/20260522141623.600235-2-zli94@ncsu.edu1 parent 63c1a12 commit dfcfc97
3 files changed
Lines changed: 19 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15083 | 15083 | | |
15084 | 15084 | | |
15085 | 15085 | | |
15086 | | - | |
15087 | | - | |
15088 | 15086 | | |
15089 | 15087 | | |
15090 | 15088 | | |
| |||
15093 | 15091 | | |
15094 | 15092 | | |
15095 | 15093 | | |
| 15094 | + | |
15096 | 15095 | | |
15097 | 15096 | | |
15098 | 15097 | | |
| |||
15109 | 15108 | | |
15110 | 15109 | | |
15111 | 15110 | | |
15112 | | - | |
15113 | | - | |
15114 | | - | |
| 15111 | + | |
| 15112 | + | |
| 15113 | + | |
15115 | 15114 | | |
15116 | 15115 | | |
15117 | | - | |
15118 | | - | |
15119 | | - | |
15120 | | - | |
15121 | | - | |
| 15116 | + | |
| 15117 | + | |
15122 | 15118 | | |
15123 | 15119 | | |
15124 | 15120 | | |
15125 | 15121 | | |
15126 | 15122 | | |
15127 | 15123 | | |
15128 | 15124 | | |
15129 | | - | |
15130 | | - | |
15131 | 15125 | | |
15132 | 15126 | | |
15133 | 15127 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2294 | 2294 | | |
2295 | 2295 | | |
2296 | 2296 | | |
| 2297 | + | |
| 2298 | + | |
| 2299 | + | |
| 2300 | + | |
| 2301 | + | |
| 2302 | + | |
| 2303 | + | |
| 2304 | + | |
| 2305 | + | |
| 2306 | + | |
| 2307 | + | |
| 2308 | + | |
2297 | 2309 | | |
2298 | 2310 | | |
2299 | 2311 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | 92 | | |
100 | 93 | | |
101 | 94 | | |
102 | 95 | | |
103 | 96 | | |
104 | | - | |
| 97 | + | |
105 | 98 | | |
106 | 99 | | |
107 | 100 | | |
| |||
0 commit comments