mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v9 RESEND 0/3] sched/fair: Optimize cfs_rq and sched_entity allocation for better data locality
@ 2026-03-19 17:52 Zecheng Li
  2026-03-19 17:52 ` [PATCH v9 RESEND 1/3] sched/fair: Co-locate cfs_rq and sched_entity in cfs_tg_state Zecheng Li
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Zecheng Li @ 2026-03-19 17:52 UTC (permalink / raw)
  To: Ingo Molnar, Peter Zijlstra, Juri Lelli, Vincent Guittot
  Cc: Dietmar Eggemann, Steven Rostedt, Ben Segall, Mel Gorman,
	Valentin Schneider, Rik van Riel, Chris Mason,
	Madadi Vineeth Reddy, Xu Liu, Blake Jones, Josh Don, Nilay Vaish,
	K Prateek Nayak, Andrew Morton, linux-kernel, Zecheng Li

Hi all,

This patch series improves CFS cache performance by allocating cfs_rq
and sched_entity together in the per-cpu allocator. It allows for
replacing the pointer arrays in task_group with a per-cpu offset.

Note: Resending to correct the recipient email address.

v9:
- Rebased on latest tip/sched/core (v7.0.0-rc4), fixing minor conflicts
  from upstream using kzalloc_objs instead of original kcalloc. Tested
  with selftests/cgroup in QEMU.
- Kept Reviewed-by tags from v8, but dropped the Tested-by tags due to
  major version bump.

v8:
- Simplified free_fair_sched_group() in patch 1, use direct kfree
  instead of container_of since cfs_rq is at offset 0 (Prateek)
- Moved variable declarations to top of function scope (Prateek)

v7:
- Removed struct sched_entity_stats, using cfs_tg_state to contain all
  three structs: cfs_rq, sched_entity, and sched_statistics since they
  are always allocated together in alloc_fair_sched_group. (Josh)

v6:
- Rebased on latest tip/sched/core.
- Added my personal email as a secondary Signed-off-by.
- Note: I no longer have access to zecheng@google.com. I am picking
this series up from my personal address.

v5:
- Rebased on tip/sched/core (Resolved a minor conflict in patch 3)
- Friendly ping on the series as it's not receiving any comments

v4:
https://lore.kernel.org/all/20250903194503.1679687-1-zecheng@google.com/
- Rebased on tip/sched/core
- Intel kernel test robot results
https://lore.kernel.org/all/202507161052.ed3213f4-lkp@intel.com/

v3:
https://lore.kernel.org/all/20250701210230.2985885-1-zecheng@google.com/
- Rebased on top of 6.16-rc4.
- Minor wording and comment updates.

v2:
https://lore.kernel.org/lkml/20250609193834.2556866-1-zecheng@google.com/
- Allocate cfs_rq and sched_entity together for non-root task group
  instead of embedding sched_entity into cfs_rq to avoid increasing the
  size of struct rq based on the feedback from Peter Zijlstra.

v1:
https://lore.kernel.org/lkml/20250604195846.193159-1-zecheng@google.com/

Accessing cfs_rq and sched_entity instances incurs many cache misses.
This series of patches aims to reduce these cache misses. A struct
cfs_rq instance is per CPU and per task_group. Each task_group instance
(and the root runqueue) holds cfs_rq instances per CPU. Additionally,
there are corresponding struct sched_entity instances for each cfs_rq
instance (except the root). Currently, both cfs_rq and sched_entity
instances are allocated in NUMA-local memory using kzalloc_node, and
tg->cfs_rq and tg->se are arrays of pointers.

Original memory layout:

	tg->cfs_rq = kcalloc(nr_cpu_ids, sizeof(cfs_rq), GFP_KERNEL);
	tg->se = kcalloc(nr_cpu_ids, sizeof(se), GFP_KERNEL);

	+----+       +-----------------+
	| tg | ----> | cfs_rq pointers |
	+----+       +-----------------+
	                |     |     |
	                v     v     v
	            cfs_rq cfs_rq cfs_rq

	+----+       +--------------------+
	| tg | ----> | sched_entity ptrs  |
	+----+       +--------------------+
	                |     |     |
	                v     v     v
	                se    se    se

Layout after Optimization:

	+--------+      | CPU 0  |	| CPU 1  |	| CPU 2  |
	|   tg   |      | percpu |	| percpu |	| percpu |
	|        |         ...             ...             ...
	| percpu |  ->  | cfs_rq |	| cfs_rq |	| cfs_rq |
	| offset |      |   se   |	|   se   |	|   se   |
	+--------+      +--------+	+--------+	+--------+

The optimization includes two parts:

1) Co-allocate cfs_rq and sched_entity for non-root task groups.

- This benefits loading the sched_entity for the parent runqueue.
  Currently it incurs pointer chasing, i.e., cfs_rq->tg->se[cpu]. After
  co-locating, the sched_entity fields can be loaded with simple offset
  computations from cfs_rq.

2) Allocate the combined cfs_rq/se struct using percpu allocator.

- Accesses to cfs_rq instances in hot paths are mostly iterating through
  multiple task_groups for the same CPU. Therefore, the new percpu
  layout can reuse the base pointer, and they are more likely to reside
  in the CPU cache than the per-task_group pointer arrays.

- This optimization also reduces the memory needed for the array of
  pointers.

To measure the impact of the patch series, we construct a tree structure
hierarchy of cgroups, with “width” and “depth” parameters controlling
the number of children per node and the depth of the tree. Each leaf
cgroup runs a schbench workload and gets an 80% quota of the total CPU
quota divided by number of leaf cgroups (in other words, the target CPU
load is set to 80%) to exercise the throttling functions. Bandwidth
control period is set to 10ms. We run the benchmark on Intel and AMD
machines; each machine has hundreds of threads.

Tests were conducted on 6.15.

| Kernel LLC Misses | depth 3 width 10    | depth 5 width 4     |
+-------------------+---------------------+---------------------+
| AMD-orig          | [2218.98, 2241.89]M | [2599.80, 2645.16]M |
| AMD-opt           | [1957.62, 1981.55]M | [2380.47, 2431.86]M |
| Change            | -11.69%             | -8.248%             |
| Intel-orig        | [1580.53, 1604.90]M | [2125.37, 2208.68]M |
| Intel-opt         | [1066.94, 1100.19]M | [1543.77, 1570.83]M |
| Change            | -31.96%             | -28.13%             |

There's also a 25% improvement on kernel IPC on the AMD system. On
Intel, the improvement is 3% despite a greater LLC miss reduction.

Other workloads without CPU share limits, while also running in a cgroup
hierarchy with O(1000) instances, show no obvious regression:

sysbench, hackbench - lower is better; ebizzy - higher is better.

workload  | base                  | opt                   | metric
----------+-----------------------+-----------------------+------------
sysbench  | 63.55, [63.04, 64.05] | 64.36, [62.97, 65.75] | avg latency
hackbench | 36.95, [35.45, 38.45] | 37.12, [35.81, 38.44] | time
ebizzy    | 610.7, [569.8, 651.6] | 613.5, [592.1, 635.0] | record/s

Zecheng Li (3):
  sched/fair: Co-locate cfs_rq and sched_entity in cfs_tg_state
  sched/fair: Remove task_group->se pointer array
  sched/fair: Allocate cfs_tg_state with percpu allocator

 kernel/sched/core.c  | 40 ++++++++-------------
 kernel/sched/debug.c |  2 +-
 kernel/sched/fair.c  | 83 ++++++++++++++++----------------------------
 kernel/sched/sched.h | 55 ++++++++++++++++++++++++-----
 kernel/sched/stats.h |  9 +----
 5 files changed, 93 insertions(+), 96 deletions(-)

-- 
2.53.0

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v9 RESEND 1/3] sched/fair: Co-locate cfs_rq and sched_entity in cfs_tg_state
  2026-03-19 17:52 [PATCH v9 RESEND 0/3] sched/fair: Optimize cfs_rq and sched_entity allocation for better data locality Zecheng Li
@ 2026-03-19 17:52 ` Zecheng Li
  2026-03-31 19:35   ` Josh Don
  2026-03-19 17:52 ` [PATCH v9 RESEND 2/3] sched/fair: Remove task_group->se pointer array Zecheng Li
  2026-03-19 17:52 ` [PATCH v9 RESEND 3/3] sched/fair: Allocate cfs_tg_state with percpu allocator Zecheng Li
  2 siblings, 1 reply; 9+ messages in thread
From: Zecheng Li @ 2026-03-19 17:52 UTC (permalink / raw)
  To: Ingo Molnar, Peter Zijlstra, Juri Lelli, Vincent Guittot
  Cc: Dietmar Eggemann, Steven Rostedt, Ben Segall, Mel Gorman,
	Valentin Schneider, Rik van Riel, Chris Mason,
	Madadi Vineeth Reddy, Xu Liu, Blake Jones, Josh Don, Nilay Vaish,
	K Prateek Nayak, Andrew Morton, linux-kernel, Zecheng Li,
	Zecheng Li

From: Zecheng Li <zecheng@google.com>

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>
Reviewed-by: K Prateek Nayak <kprateek.nayak@amd.com>
---
 kernel/sched/fair.c  | 18 ++++++------------
 kernel/sched/sched.h | 12 ++++++++++++
 kernel/sched/stats.h |  9 +--------
 3 files changed, 19 insertions(+), 20 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 0a35a82e4792..79160d419c9f 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -13877,8 +13877,6 @@ void free_fair_sched_group(struct task_group *tg)
 	for_each_possible_cpu(i) {
 		if (tg->cfs_rq)
 			kfree(tg->cfs_rq[i]);
-		if (tg->se)
-			kfree(tg->se[i]);
 	}
 
 	kfree(tg->cfs_rq);
@@ -13887,6 +13885,7 @@ void free_fair_sched_group(struct task_group *tg)
 
 int alloc_fair_sched_group(struct task_group *tg, struct task_group *parent)
 {
+	struct cfs_tg_state *state;
 	struct sched_entity *se;
 	struct cfs_rq *cfs_rq;
 	int i;
@@ -13903,16 +13902,13 @@ int alloc_fair_sched_group(struct task_group *tg, struct task_group *parent)
 	init_cfs_bandwidth(tg_cfs_bandwidth(tg), tg_cfs_bandwidth(parent));
 
 	for_each_possible_cpu(i) {
-		cfs_rq = kzalloc_node(sizeof(struct cfs_rq),
-				      GFP_KERNEL, cpu_to_node(i));
-		if (!cfs_rq)
+		state = kzalloc_node(sizeof(*state),
+				     GFP_KERNEL, cpu_to_node(i));
+		if (!state)
 			goto err;
 
-		se = kzalloc_node(sizeof(struct sched_entity_stats),
-				  GFP_KERNEL, cpu_to_node(i));
-		if (!se)
-			goto err_free_rq;
-
+		cfs_rq = &state->cfs_rq;
+		se = &state->se;
 		init_cfs_rq(cfs_rq);
 		init_tg_cfs_entry(tg, cfs_rq, se, i, parent->se[i]);
 		init_entity_runnable_average(se);
@@ -13920,8 +13916,6 @@ int alloc_fair_sched_group(struct task_group *tg, struct task_group *parent)
 
 	return 1;
 
-err_free_rq:
-	kfree(cfs_rq);
 err:
 	return 0;
 }
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index b863bbda6de8..826f21fa3f36 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -2249,6 +2249,18 @@ static inline struct task_group *task_group(struct task_struct *p)
 	return p->sched_task_group;
 }
 
+#ifdef CONFIG_FAIR_GROUP_SCHED
+/*
+ * Defined here to be available before stats.h is included, since
+ * stats.h has dependencies on things defined later in this file.
+ */
+struct cfs_tg_state {
+	struct cfs_rq		cfs_rq;
+	struct sched_entity	se;
+	struct sched_statistics	stats;
+} __no_randomize_layout;
+#endif
+
 /* Change a task's cfs_rq and parent entity if it moves across CPUs/groups */
 static inline void set_task_rq(struct task_struct *p, unsigned int cpu)
 {
diff --git a/kernel/sched/stats.h b/kernel/sched/stats.h
index a612cf253c87..ebe0a7765f98 100644
--- a/kernel/sched/stats.h
+++ b/kernel/sched/stats.h
@@ -89,19 +89,12 @@ static inline void rq_sched_info_depart  (struct rq *rq, unsigned long long delt
 
 #endif /* CONFIG_SCHEDSTATS */
 
-#ifdef CONFIG_FAIR_GROUP_SCHED
-struct sched_entity_stats {
-	struct sched_entity     se;
-	struct sched_statistics stats;
-} __no_randomize_layout;
-#endif
-
 static inline struct sched_statistics *
 __schedstats_from_se(struct sched_entity *se)
 {
 #ifdef CONFIG_FAIR_GROUP_SCHED
 	if (!entity_is_task(se))
-		return &container_of(se, struct sched_entity_stats, se)->stats;
+		return &container_of(se, struct cfs_tg_state, se)->stats;
 #endif
 	return &task_of(se)->stats;
 }
-- 
2.53.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v9 RESEND 2/3] sched/fair: Remove task_group->se pointer array
  2026-03-19 17:52 [PATCH v9 RESEND 0/3] sched/fair: Optimize cfs_rq and sched_entity allocation for better data locality Zecheng Li
  2026-03-19 17:52 ` [PATCH v9 RESEND 1/3] sched/fair: Co-locate cfs_rq and sched_entity in cfs_tg_state Zecheng Li
@ 2026-03-19 17:52 ` Zecheng Li
  2026-03-31 19:42   ` Josh Don
  2026-03-19 17:52 ` [PATCH v9 RESEND 3/3] sched/fair: Allocate cfs_tg_state with percpu allocator Zecheng Li
  2 siblings, 1 reply; 9+ messages in thread
From: Zecheng Li @ 2026-03-19 17:52 UTC (permalink / raw)
  To: Ingo Molnar, Peter Zijlstra, Juri Lelli, Vincent Guittot
  Cc: Dietmar Eggemann, Steven Rostedt, Ben Segall, Mel Gorman,
	Valentin Schneider, Rik van Riel, Chris Mason,
	Madadi Vineeth Reddy, Xu Liu, Blake Jones, Josh Don, Nilay Vaish,
	K Prateek Nayak, Andrew Morton, linux-kernel, Zecheng Li,
	Zecheng Li

From: Zecheng Li <zecheng@google.com>

Now that struct sched_entity is co-located with struct cfs_rq for
non-root task groups, the task_group->se pointer array is redundant. The
associated sched_entity can be loaded directly from the cfs_rq.

This patch performs the access conversion with the helpers:

- is_root_task_group(tg): checks if a task group is the root task group.
It compares the task group's address with the global root_task_group
variable.

- tg_se(tg, cpu): retrieves the cfs_rq and returns the address of the
co-located se. This function checks if tg is the root task group to
ensure behaving the same of previous tg->se[cpu]. Replaces all accesses
that use the tg->se[cpu] pointer array with calls to the new tg_se(tg,
cpu) accessor.

- cfs_rq_se(cfs_rq): simplifies access paths like cfs_rq->tg->se[...] to
use the co-located sched_entity. This function also checks if tg is the
root task group to ensure same behavior.

Since tg_se is not in very hot code paths, and the branch is a register
comparison with an immediate value (`&root_task_group`), the performance
impact is expected to be negligible.

Signed-off-by: Zecheng Li <zecheng@google.com>
Signed-off-by: Zecheng Li <zli94@ncsu.edu>
Reviewed-by: K Prateek Nayak <kprateek.nayak@amd.com>
---
 kernel/sched/core.c  |  7 ++-----
 kernel/sched/debug.c |  2 +-
 kernel/sched/fair.c  | 25 +++++++++----------------
 kernel/sched/sched.h | 31 ++++++++++++++++++++++++++-----
 4 files changed, 38 insertions(+), 27 deletions(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 64b467c1d5b6..2df42786f780 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -8609,7 +8609,7 @@ void __init sched_init(void)
 	wait_bit_init();
 
 #ifdef CONFIG_FAIR_GROUP_SCHED
-	ptr += 2 * nr_cpu_ids * sizeof(void **);
+	ptr += nr_cpu_ids * sizeof(void **);
 #endif
 #ifdef CONFIG_RT_GROUP_SCHED
 	ptr += 2 * nr_cpu_ids * sizeof(void **);
@@ -8618,9 +8618,6 @@ void __init sched_init(void)
 		ptr = (unsigned long)kzalloc(ptr, GFP_NOWAIT);
 
 #ifdef CONFIG_FAIR_GROUP_SCHED
-		root_task_group.se = (struct sched_entity **)ptr;
-		ptr += nr_cpu_ids * sizeof(void **);
-
 		root_task_group.cfs_rq = (struct cfs_rq **)ptr;
 		ptr += nr_cpu_ids * sizeof(void **);
 
@@ -9697,7 +9694,7 @@ static int cpu_cfs_stat_show(struct seq_file *sf, void *v)
 		int i;
 
 		for_each_possible_cpu(i) {
-			stats = __schedstats_from_se(tg->se[i]);
+			stats = __schedstats_from_se(tg_se(tg, i));
 			ws += schedstat_val(stats->wait_sum);
 		}
 
diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c
index 6246008c431e..7e7860d56b4b 100644
--- a/kernel/sched/debug.c
+++ b/kernel/sched/debug.c
@@ -750,7 +750,7 @@ void dirty_sched_domain_sysctl(int cpu)
 #ifdef CONFIG_FAIR_GROUP_SCHED
 static void print_cfs_group_stats(struct seq_file *m, int cpu, struct task_group *tg)
 {
-	struct sched_entity *se = tg->se[cpu];
+	struct sched_entity *se = tg_se(tg, cpu);
 
 #define P(F)		SEQ_printf(m, "  .%-30s: %lld\n",	#F, (long long)F)
 #define P_SCHEDSTAT(F)	SEQ_printf(m, "  .%-30s: %lld\n",	\
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 79160d419c9f..c116e7c2b916 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -6212,7 +6212,7 @@ void unthrottle_cfs_rq(struct cfs_rq *cfs_rq)
 {
 	struct rq *rq = rq_of(cfs_rq);
 	struct cfs_bandwidth *cfs_b = tg_cfs_bandwidth(cfs_rq->tg);
-	struct sched_entity *se = cfs_rq->tg->se[cpu_of(rq)];
+	struct sched_entity *se = cfs_rq_se(cfs_rq);
 
 	/*
 	 * It's possible we are called with runtime_remaining < 0 due to things
@@ -10067,7 +10067,6 @@ static bool __update_blocked_fair(struct rq *rq, bool *done)
 {
 	struct cfs_rq *cfs_rq, *pos;
 	bool decayed = false;
-	int cpu = cpu_of(rq);
 
 	/*
 	 * Iterates the task_group tree in a bottom up fashion, see
@@ -10087,7 +10086,7 @@ static bool __update_blocked_fair(struct rq *rq, bool *done)
 		}
 
 		/* Propagate pending load changes to the parent, if any: */
-		se = cfs_rq->tg->se[cpu];
+		se = cfs_rq_se(cfs_rq);
 		if (se && !skip_blocked_update(se))
 			update_load_avg(cfs_rq_of(se), se, UPDATE_TG);
 
@@ -10113,8 +10112,7 @@ static bool __update_blocked_fair(struct rq *rq, bool *done)
  */
 static void update_cfs_rq_h_load(struct cfs_rq *cfs_rq)
 {
-	struct rq *rq = rq_of(cfs_rq);
-	struct sched_entity *se = cfs_rq->tg->se[cpu_of(rq)];
+	struct sched_entity *se = cfs_rq_se(cfs_rq);
 	unsigned long now = jiffies;
 	unsigned long load;
 
@@ -13880,7 +13878,6 @@ void free_fair_sched_group(struct task_group *tg)
 	}
 
 	kfree(tg->cfs_rq);
-	kfree(tg->se);
 }
 
 int alloc_fair_sched_group(struct task_group *tg, struct task_group *parent)
@@ -13893,9 +13890,6 @@ int alloc_fair_sched_group(struct task_group *tg, struct task_group *parent)
 	tg->cfs_rq = kzalloc_objs(cfs_rq, nr_cpu_ids);
 	if (!tg->cfs_rq)
 		goto err;
-	tg->se = kzalloc_objs(se, nr_cpu_ids);
-	if (!tg->se)
-		goto err;
 
 	tg->shares = NICE_0_LOAD;
 
@@ -13910,7 +13904,7 @@ int alloc_fair_sched_group(struct task_group *tg, struct task_group *parent)
 		cfs_rq = &state->cfs_rq;
 		se = &state->se;
 		init_cfs_rq(cfs_rq);
-		init_tg_cfs_entry(tg, cfs_rq, se, i, parent->se[i]);
+		init_tg_cfs_entry(tg, cfs_rq, se, i, tg_se(parent, i));
 		init_entity_runnable_average(se);
 	}
 
@@ -13929,7 +13923,7 @@ void online_fair_sched_group(struct task_group *tg)
 
 	for_each_possible_cpu(i) {
 		rq = cpu_rq(i);
-		se = tg->se[i];
+		se = tg_se(tg, i);
 		rq_lock_irq(rq, &rf);
 		update_rq_clock(rq);
 		attach_entity_cfs_rq(se);
@@ -13946,7 +13940,7 @@ void unregister_fair_sched_group(struct task_group *tg)
 
 	for_each_possible_cpu(cpu) {
 		struct cfs_rq *cfs_rq = tg->cfs_rq[cpu];
-		struct sched_entity *se = tg->se[cpu];
+		struct sched_entity *se = tg_se(tg, cpu);
 		struct rq *rq = cpu_rq(cpu);
 
 		if (se) {
@@ -13983,7 +13977,6 @@ void init_tg_cfs_entry(struct task_group *tg, struct cfs_rq *cfs_rq,
 	init_cfs_rq_runtime(cfs_rq);
 
 	tg->cfs_rq[cpu] = cfs_rq;
-	tg->se[cpu] = se;
 
 	/* se could be NULL for root_task_group */
 	if (!se)
@@ -14014,7 +14007,7 @@ static int __sched_group_set_shares(struct task_group *tg, unsigned long shares)
 	/*
 	 * We can't change the weight of the root cgroup.
 	 */
-	if (!tg->se[0])
+	if (is_root_task_group(tg))
 		return -EINVAL;
 
 	shares = clamp(shares, scale_load(MIN_SHARES), scale_load(MAX_SHARES));
@@ -14025,7 +14018,7 @@ static int __sched_group_set_shares(struct task_group *tg, unsigned long shares)
 	tg->shares = shares;
 	for_each_possible_cpu(i) {
 		struct rq *rq = cpu_rq(i);
-		struct sched_entity *se = tg->se[i];
+		struct sched_entity *se = tg_se(tg, i);
 		struct rq_flags rf;
 
 		/* Propagate contribution to hierarchy */
@@ -14076,7 +14069,7 @@ int sched_group_set_idle(struct task_group *tg, long idle)
 
 	for_each_possible_cpu(i) {
 		struct rq *rq = cpu_rq(i);
-		struct sched_entity *se = tg->se[i];
+		struct sched_entity *se = tg_se(tg, i);
 		struct cfs_rq *grp_cfs_rq = tg->cfs_rq[i];
 		bool was_idle = cfs_rq_is_idle(grp_cfs_rq);
 		long idle_task_delta;
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 826f21fa3f36..258dc689a535 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -480,8 +480,6 @@ struct task_group {
 #endif
 
 #ifdef CONFIG_FAIR_GROUP_SCHED
-	/* schedulable entities of this group on each CPU */
-	struct sched_entity	**se;
 	/* runqueue "owned" by this group on each CPU */
 	struct cfs_rq		**cfs_rq;
 	unsigned long		shares;
@@ -920,7 +918,8 @@ struct dl_rq {
 };
 
 #ifdef CONFIG_FAIR_GROUP_SCHED
-
+/* Check whether a task group is root tg */
+#define is_root_task_group(tg) ((tg) == &root_task_group)
 /* An entity is a task if it doesn't "own" a runqueue */
 #define entity_is_task(se)	(!se->my_q)
 
@@ -2259,6 +2258,28 @@ struct cfs_tg_state {
 	struct sched_entity	se;
 	struct sched_statistics	stats;
 } __no_randomize_layout;
+
+static inline struct sched_entity *tg_se(struct task_group *tg, int cpu)
+{
+	struct cfs_tg_state *state;
+
+	if (is_root_task_group(tg))
+		return NULL;
+
+	state = container_of(tg->cfs_rq[cpu], struct cfs_tg_state, cfs_rq);
+	return &state->se;
+}
+
+static inline struct sched_entity *cfs_rq_se(struct cfs_rq *cfs_rq)
+{
+	struct cfs_tg_state *state;
+
+	if (is_root_task_group(cfs_rq->tg))
+		return NULL;
+
+	state = container_of(cfs_rq, struct cfs_tg_state, cfs_rq);
+	return &state->se;
+}
 #endif
 
 /* Change a task's cfs_rq and parent entity if it moves across CPUs/groups */
@@ -2271,8 +2292,8 @@ static inline void set_task_rq(struct task_struct *p, unsigned int cpu)
 #ifdef CONFIG_FAIR_GROUP_SCHED
 	set_task_rq_fair(&p->se, p->se.cfs_rq, tg->cfs_rq[cpu]);
 	p->se.cfs_rq = tg->cfs_rq[cpu];
-	p->se.parent = tg->se[cpu];
-	p->se.depth = tg->se[cpu] ? tg->se[cpu]->depth + 1 : 0;
+	p->se.parent = tg_se(tg, cpu);
+	p->se.depth = p->se.parent ? p->se.parent->depth + 1 : 0;
 #endif
 
 #ifdef CONFIG_RT_GROUP_SCHED
-- 
2.53.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v9 RESEND 3/3] sched/fair: Allocate cfs_tg_state with percpu allocator
  2026-03-19 17:52 [PATCH v9 RESEND 0/3] sched/fair: Optimize cfs_rq and sched_entity allocation for better data locality Zecheng Li
  2026-03-19 17:52 ` [PATCH v9 RESEND 1/3] sched/fair: Co-locate cfs_rq and sched_entity in cfs_tg_state Zecheng Li
  2026-03-19 17:52 ` [PATCH v9 RESEND 2/3] sched/fair: Remove task_group->se pointer array Zecheng Li
@ 2026-03-19 17:52 ` Zecheng Li
  2026-03-31 19:49   ` Josh Don
  2 siblings, 1 reply; 9+ messages in thread
From: Zecheng Li @ 2026-03-19 17:52 UTC (permalink / raw)
  To: Ingo Molnar, Peter Zijlstra, Juri Lelli, Vincent Guittot
  Cc: Dietmar Eggemann, Steven Rostedt, Ben Segall, Mel Gorman,
	Valentin Schneider, Rik van Riel, Chris Mason,
	Madadi Vineeth Reddy, Xu Liu, Blake Jones, Josh Don, Nilay Vaish,
	K Prateek Nayak, Andrew Morton, linux-kernel, Zecheng Li,
	Zecheng Li

From: Zecheng Li <zecheng@google.com>

To remove the cfs_rq pointer array in task_group, allocate the combined
cfs_rq and sched_entity using the per-cpu allocator.

This patch implements the following:

- Changes task_group->cfs_rq from struct cfs_rq ** to struct cfs_rq
__percpu *.

- Updates memory allocation in alloc_fair_sched_group() and
free_fair_sched_group() to use alloc_percpu() and free_percpu()
respectively.

- Uses the inline accessor tg_cfs_rq(tg, cpu) with per_cpu_ptr() to
retrieve the pointer to cfs_rq for the given task group and CPU.

- Replaces direct accesses tg->cfs_rq[cpu] with calls to the new
tg_cfs_rq(tg, cpu) helper.

- Handles the root_task_group: since struct rq is already a per-cpu
variable (runqueues), its embedded cfs_rq (rq->cfs) is also per-cpu.
Therefore, we assign root_task_group.cfs_rq = &runqueues.cfs.

- Cleanup the code in initializing the root task group.

This change places each CPU's cfs_rq and sched_entity in its local
per-cpu memory area to remove the per-task_group pointer arrays.

Signed-off-by: Zecheng Li <zecheng@google.com>
Signed-off-by: Zecheng Li <zli94@ncsu.edu>
Reviewed-by: K Prateek Nayak <kprateek.nayak@amd.com>
---
 kernel/sched/core.c  | 35 +++++++++++-----------------
 kernel/sched/fair.c  | 54 ++++++++++++++++++--------------------------
 kernel/sched/sched.h | 14 ++++++++----
 3 files changed, 45 insertions(+), 58 deletions(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 2df42786f780..0e03b257ca9a 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -8593,7 +8593,7 @@ static struct kmem_cache *task_group_cache __ro_after_init;
 
 void __init sched_init(void)
 {
-	unsigned long ptr = 0;
+	unsigned long __maybe_unused ptr = 0;
 	int i;
 
 	/* Make sure the linker didn't screw up */
@@ -8609,33 +8609,24 @@ void __init sched_init(void)
 	wait_bit_init();
 
 #ifdef CONFIG_FAIR_GROUP_SCHED
-	ptr += nr_cpu_ids * sizeof(void **);
-#endif
-#ifdef CONFIG_RT_GROUP_SCHED
-	ptr += 2 * nr_cpu_ids * sizeof(void **);
-#endif
-	if (ptr) {
-		ptr = (unsigned long)kzalloc(ptr, GFP_NOWAIT);
+	root_task_group.cfs_rq = &runqueues.cfs;
 
-#ifdef CONFIG_FAIR_GROUP_SCHED
-		root_task_group.cfs_rq = (struct cfs_rq **)ptr;
-		ptr += nr_cpu_ids * sizeof(void **);
-
-		root_task_group.shares = ROOT_TASK_GROUP_LOAD;
-		init_cfs_bandwidth(&root_task_group.cfs_bandwidth, NULL);
+	root_task_group.shares = ROOT_TASK_GROUP_LOAD;
+	init_cfs_bandwidth(&root_task_group.cfs_bandwidth, NULL);
 #endif /* CONFIG_FAIR_GROUP_SCHED */
 #ifdef CONFIG_EXT_GROUP_SCHED
-		scx_tg_init(&root_task_group);
+	scx_tg_init(&root_task_group);
 #endif /* CONFIG_EXT_GROUP_SCHED */
 #ifdef CONFIG_RT_GROUP_SCHED
-		root_task_group.rt_se = (struct sched_rt_entity **)ptr;
-		ptr += nr_cpu_ids * sizeof(void **);
+	ptr += 2 * nr_cpu_ids * sizeof(void **);
+	ptr = (unsigned long)kzalloc(ptr, GFP_NOWAIT);
+	root_task_group.rt_se = (struct sched_rt_entity **)ptr;
+	ptr += nr_cpu_ids * sizeof(void **);
 
-		root_task_group.rt_rq = (struct rt_rq **)ptr;
-		ptr += nr_cpu_ids * sizeof(void **);
+	root_task_group.rt_rq = (struct rt_rq **)ptr;
+	ptr += nr_cpu_ids * sizeof(void **);
 
 #endif /* CONFIG_RT_GROUP_SCHED */
-	}
 
 	init_defrootdomain();
 
@@ -9545,7 +9536,7 @@ static int tg_set_cfs_bandwidth(struct task_group *tg,
 	}
 
 	for_each_online_cpu(i) {
-		struct cfs_rq *cfs_rq = tg->cfs_rq[i];
+		struct cfs_rq *cfs_rq = tg_cfs_rq(tg, i);
 		struct rq *rq = cfs_rq->rq;
 
 		guard(rq_lock_irq)(rq);
@@ -9713,7 +9704,7 @@ static u64 throttled_time_self(struct task_group *tg)
 	u64 total = 0;
 
 	for_each_possible_cpu(i) {
-		total += READ_ONCE(tg->cfs_rq[i]->throttled_clock_self_time);
+		total += READ_ONCE(tg_cfs_rq(tg, i)->throttled_clock_self_time);
 	}
 
 	return total;
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index c116e7c2b916..5a6491edcf31 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -334,7 +334,7 @@ static inline bool list_add_leaf_cfs_rq(struct cfs_rq *cfs_rq)
 	 * to a tree or when we reach the top of the tree
 	 */
 	if (cfs_rq->tg->parent &&
-	    cfs_rq->tg->parent->cfs_rq[cpu]->on_list) {
+	    tg_cfs_rq(cfs_rq->tg->parent, cpu)->on_list) {
 		/*
 		 * If parent is already on the list, we add the child
 		 * just before. Thanks to circular linked property of
@@ -342,7 +342,7 @@ static inline bool list_add_leaf_cfs_rq(struct cfs_rq *cfs_rq)
 		 * of the list that starts by parent.
 		 */
 		list_add_tail_rcu(&cfs_rq->leaf_cfs_rq_list,
-			&(cfs_rq->tg->parent->cfs_rq[cpu]->leaf_cfs_rq_list));
+			&(tg_cfs_rq(cfs_rq->tg->parent, cpu)->leaf_cfs_rq_list));
 		/*
 		 * The branch is now connected to its tree so we can
 		 * reset tmp_alone_branch to the beginning of the
@@ -4387,7 +4387,7 @@ static void __maybe_unused clear_tg_offline_cfs_rqs(struct rq *rq)
 
 	rcu_read_lock();
 	list_for_each_entry_rcu(tg, &task_groups, list) {
-		struct cfs_rq *cfs_rq = tg->cfs_rq[cpu_of(rq)];
+		struct cfs_rq *cfs_rq = tg_cfs_rq(tg, cpu_of(rq));
 
 		clear_tg_load_avg(cfs_rq);
 	}
@@ -5930,7 +5930,7 @@ static inline int throttled_hierarchy(struct cfs_rq *cfs_rq)
 
 static inline int lb_throttled_hierarchy(struct task_struct *p, int dst_cpu)
 {
-	return throttled_hierarchy(task_group(p)->cfs_rq[dst_cpu]);
+	return throttled_hierarchy(tg_cfs_rq(task_group(p), dst_cpu));
 }
 
 static inline bool task_is_throttled(struct task_struct *p)
@@ -6076,7 +6076,7 @@ static void enqueue_task_fair(struct rq *rq, struct task_struct *p, int flags);
 static int tg_unthrottle_up(struct task_group *tg, void *data)
 {
 	struct rq *rq = data;
-	struct cfs_rq *cfs_rq = tg->cfs_rq[cpu_of(rq)];
+	struct cfs_rq *cfs_rq = tg_cfs_rq(tg, cpu_of(rq));
 	struct task_struct *p, *tmp;
 
 	if (--cfs_rq->throttle_count)
@@ -6147,7 +6147,7 @@ static void record_throttle_clock(struct cfs_rq *cfs_rq)
 static int tg_throttle_down(struct task_group *tg, void *data)
 {
 	struct rq *rq = data;
-	struct cfs_rq *cfs_rq = tg->cfs_rq[cpu_of(rq)];
+	struct cfs_rq *cfs_rq = tg_cfs_rq(tg, cpu_of(rq));
 
 	if (cfs_rq->throttle_count++)
 		return 0;
@@ -6621,8 +6621,8 @@ static void sync_throttle(struct task_group *tg, int cpu)
 	if (!tg->parent)
 		return;
 
-	cfs_rq = tg->cfs_rq[cpu];
-	pcfs_rq = tg->parent->cfs_rq[cpu];
+	cfs_rq = tg_cfs_rq(tg, cpu);
+	pcfs_rq = tg_cfs_rq(tg->parent, cpu);
 
 	cfs_rq->throttle_count = pcfs_rq->throttle_count;
 	cfs_rq->throttled_clock_pelt = rq_clock_pelt(cpu_rq(cpu));
@@ -6814,7 +6814,7 @@ static void __maybe_unused update_runtime_enabled(struct rq *rq)
 	rcu_read_lock();
 	list_for_each_entry_rcu(tg, &task_groups, list) {
 		struct cfs_bandwidth *cfs_b = &tg->cfs_bandwidth;
-		struct cfs_rq *cfs_rq = tg->cfs_rq[cpu_of(rq)];
+		struct cfs_rq *cfs_rq = tg_cfs_rq(tg, cpu_of(rq));
 
 		raw_spin_lock(&cfs_b->lock);
 		cfs_rq->runtime_enabled = cfs_b->quota != RUNTIME_INF;
@@ -6843,7 +6843,7 @@ static void __maybe_unused unthrottle_offline_cfs_rqs(struct rq *rq)
 
 	rcu_read_lock();
 	list_for_each_entry_rcu(tg, &task_groups, list) {
-		struct cfs_rq *cfs_rq = tg->cfs_rq[cpu_of(rq)];
+		struct cfs_rq *cfs_rq = tg_cfs_rq(tg, cpu_of(rq));
 
 		if (!cfs_rq->runtime_enabled)
 			continue;
@@ -9636,7 +9636,7 @@ static inline int task_is_ineligible_on_dst_cpu(struct task_struct *p, int dest_
 	struct cfs_rq *dst_cfs_rq;
 
 #ifdef CONFIG_FAIR_GROUP_SCHED
-	dst_cfs_rq = task_group(p)->cfs_rq[dest_cpu];
+	dst_cfs_rq = tg_cfs_rq(task_group(p), dest_cpu);
 #else
 	dst_cfs_rq = &cpu_rq(dest_cpu)->cfs;
 #endif
@@ -13604,7 +13604,7 @@ static int task_is_throttled_fair(struct task_struct *p, int cpu)
 	struct cfs_rq *cfs_rq;
 
 #ifdef CONFIG_FAIR_GROUP_SCHED
-	cfs_rq = task_group(p)->cfs_rq[cpu];
+	cfs_rq = tg_cfs_rq(task_group(p), cpu);
 #else
 	cfs_rq = &cpu_rq(cpu)->cfs;
 #endif
@@ -13870,39 +13870,31 @@ static void task_change_group_fair(struct task_struct *p)
 
 void free_fair_sched_group(struct task_group *tg)
 {
-	int i;
-
-	for_each_possible_cpu(i) {
-		if (tg->cfs_rq)
-			kfree(tg->cfs_rq[i]);
-	}
-
-	kfree(tg->cfs_rq);
+	free_percpu(tg->cfs_rq);
 }
 
 int alloc_fair_sched_group(struct task_group *tg, struct task_group *parent)
 {
-	struct cfs_tg_state *state;
+	struct cfs_tg_state __percpu *state;
 	struct sched_entity *se;
 	struct cfs_rq *cfs_rq;
 	int i;
 
-	tg->cfs_rq = kzalloc_objs(cfs_rq, nr_cpu_ids);
-	if (!tg->cfs_rq)
+	state = alloc_percpu_gfp(struct cfs_tg_state, GFP_KERNEL);
+	if (!state)
 		goto err;
 
+	tg->cfs_rq = &state->cfs_rq;
 	tg->shares = NICE_0_LOAD;
 
 	init_cfs_bandwidth(tg_cfs_bandwidth(tg), tg_cfs_bandwidth(parent));
 
 	for_each_possible_cpu(i) {
-		state = kzalloc_node(sizeof(*state),
-				     GFP_KERNEL, cpu_to_node(i));
-		if (!state)
+		cfs_rq = tg_cfs_rq(tg, i);
+		if (!cfs_rq)
 			goto err;
 
-		cfs_rq = &state->cfs_rq;
-		se = &state->se;
+		se = tg_se(tg, i);
 		init_cfs_rq(cfs_rq);
 		init_tg_cfs_entry(tg, cfs_rq, se, i, tg_se(parent, i));
 		init_entity_runnable_average(se);
@@ -13939,7 +13931,7 @@ void unregister_fair_sched_group(struct task_group *tg)
 	destroy_cfs_bandwidth(tg_cfs_bandwidth(tg));
 
 	for_each_possible_cpu(cpu) {
-		struct cfs_rq *cfs_rq = tg->cfs_rq[cpu];
+		struct cfs_rq *cfs_rq = tg_cfs_rq(tg, cpu);
 		struct sched_entity *se = tg_se(tg, cpu);
 		struct rq *rq = cpu_rq(cpu);
 
@@ -13976,8 +13968,6 @@ void init_tg_cfs_entry(struct task_group *tg, struct cfs_rq *cfs_rq,
 	cfs_rq->rq = rq;
 	init_cfs_rq_runtime(cfs_rq);
 
-	tg->cfs_rq[cpu] = cfs_rq;
-
 	/* se could be NULL for root_task_group */
 	if (!se)
 		return;
@@ -14070,7 +14060,7 @@ int sched_group_set_idle(struct task_group *tg, long idle)
 	for_each_possible_cpu(i) {
 		struct rq *rq = cpu_rq(i);
 		struct sched_entity *se = tg_se(tg, i);
-		struct cfs_rq *grp_cfs_rq = tg->cfs_rq[i];
+		struct cfs_rq *grp_cfs_rq = tg_cfs_rq(tg, i);
 		bool was_idle = cfs_rq_is_idle(grp_cfs_rq);
 		long idle_task_delta;
 		struct rq_flags rf;
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 258dc689a535..0d0f87e873fe 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -481,7 +481,7 @@ struct task_group {
 
 #ifdef CONFIG_FAIR_GROUP_SCHED
 	/* runqueue "owned" by this group on each CPU */
-	struct cfs_rq		**cfs_rq;
+	struct cfs_rq __percpu	*cfs_rq;
 	unsigned long		shares;
 	/*
 	 * load_avg can be heavily contended at clock tick time, so put
@@ -2259,6 +2259,12 @@ struct cfs_tg_state {
 	struct sched_statistics	stats;
 } __no_randomize_layout;
 
+/* Access a specific CPU's cfs_rq from a task group */
+static inline struct cfs_rq *tg_cfs_rq(struct task_group *tg, int cpu)
+{
+	return per_cpu_ptr(tg->cfs_rq, cpu);
+}
+
 static inline struct sched_entity *tg_se(struct task_group *tg, int cpu)
 {
 	struct cfs_tg_state *state;
@@ -2266,7 +2272,7 @@ static inline struct sched_entity *tg_se(struct task_group *tg, int cpu)
 	if (is_root_task_group(tg))
 		return NULL;
 
-	state = container_of(tg->cfs_rq[cpu], struct cfs_tg_state, cfs_rq);
+	state = container_of(tg_cfs_rq(tg, cpu), struct cfs_tg_state, cfs_rq);
 	return &state->se;
 }
 
@@ -2290,8 +2296,8 @@ static inline void set_task_rq(struct task_struct *p, unsigned int cpu)
 #endif
 
 #ifdef CONFIG_FAIR_GROUP_SCHED
-	set_task_rq_fair(&p->se, p->se.cfs_rq, tg->cfs_rq[cpu]);
-	p->se.cfs_rq = tg->cfs_rq[cpu];
+	set_task_rq_fair(&p->se, p->se.cfs_rq, tg_cfs_rq(tg, cpu));
+	p->se.cfs_rq = tg_cfs_rq(tg, cpu);
 	p->se.parent = tg_se(tg, cpu);
 	p->se.depth = p->se.parent ? p->se.parent->depth + 1 : 0;
 #endif
-- 
2.53.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v9 RESEND 1/3] sched/fair: Co-locate cfs_rq and sched_entity in cfs_tg_state
  2026-03-19 17:52 ` [PATCH v9 RESEND 1/3] sched/fair: Co-locate cfs_rq and sched_entity in cfs_tg_state Zecheng Li
@ 2026-03-31 19:35   ` Josh Don
  2026-04-01  2:57     ` K Prateek Nayak
  0 siblings, 1 reply; 9+ messages in thread
From: Josh Don @ 2026-03-31 19:35 UTC (permalink / raw)
  To: Zecheng Li
  Cc: Ingo Molnar, Peter Zijlstra, Juri Lelli, Vincent Guittot,
	Dietmar Eggemann, Steven Rostedt, Ben Segall, Mel Gorman,
	Valentin Schneider, Rik van Riel, Chris Mason,
	Madadi Vineeth Reddy, Xu Liu, Blake Jones, Nilay Vaish,
	K Prateek Nayak, Andrew Morton, linux-kernel, Zecheng Li

On Thu, Mar 19, 2026 at 10:52 AM Zecheng Li <zli94@ncsu.edu> wrote:
>
> From: Zecheng Li <zecheng@google.com>
>
> 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>
> Reviewed-by: K Prateek Nayak <kprateek.nayak@amd.com>
> ---
>  kernel/sched/fair.c  | 18 ++++++------------
>  kernel/sched/sched.h | 12 ++++++++++++
>  kernel/sched/stats.h |  9 +--------
>  3 files changed, 19 insertions(+), 20 deletions(-)
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 0a35a82e4792..79160d419c9f 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -13877,8 +13877,6 @@ void free_fair_sched_group(struct task_group *tg)
>         for_each_possible_cpu(i) {
>                 if (tg->cfs_rq)
>                         kfree(tg->cfs_rq[i]);
> -               if (tg->se)
> -                       kfree(tg->se[i]);
>         }

To be more explicit, suggest converting tg->cfs_rq[i] to an explicit
cfs_tg_state pointer via container_of, to not depend on cfs_rq being
the first member of the struct.

>
>         kfree(tg->cfs_rq);
> @@ -13887,6 +13885,7 @@ void free_fair_sched_group(struct task_group *tg)
>
>  int alloc_fair_sched_group(struct task_group *tg, struct task_group *parent)
>  {
> +       struct cfs_tg_state *state;
>         struct sched_entity *se;
>         struct cfs_rq *cfs_rq;
>         int i;
> @@ -13903,16 +13902,13 @@ int alloc_fair_sched_group(struct task_group *tg, struct task_group *parent)
>         init_cfs_bandwidth(tg_cfs_bandwidth(tg), tg_cfs_bandwidth(parent));
>
>         for_each_possible_cpu(i) {
> -               cfs_rq = kzalloc_node(sizeof(struct cfs_rq),
> -                                     GFP_KERNEL, cpu_to_node(i));
> -               if (!cfs_rq)
> +               state = kzalloc_node(sizeof(*state),
> +                                    GFP_KERNEL, cpu_to_node(i));
> +               if (!state)
>                         goto err;
>
> -               se = kzalloc_node(sizeof(struct sched_entity_stats),
> -                                 GFP_KERNEL, cpu_to_node(i));
> -               if (!se)
> -                       goto err_free_rq;
> -
> +               cfs_rq = &state->cfs_rq;
> +               se = &state->se;
>                 init_cfs_rq(cfs_rq);
>                 init_tg_cfs_entry(tg, cfs_rq, se, i, parent->se[i]);
>                 init_entity_runnable_average(se);
> @@ -13920,8 +13916,6 @@ int alloc_fair_sched_group(struct task_group *tg, struct task_group *parent)
>
>         return 1;
>
> -err_free_rq:
> -       kfree(cfs_rq);
>  err:
>         return 0;
>  }
> diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
> index b863bbda6de8..826f21fa3f36 100644
> --- a/kernel/sched/sched.h
> +++ b/kernel/sched/sched.h
> @@ -2249,6 +2249,18 @@ static inline struct task_group *task_group(struct task_struct *p)
>         return p->sched_task_group;
>  }
>
> +#ifdef CONFIG_FAIR_GROUP_SCHED
> +/*
> + * Defined here to be available before stats.h is included, since
> + * stats.h has dependencies on things defined later in this file.
> + */
> +struct cfs_tg_state {
> +       struct cfs_rq           cfs_rq;
> +       struct sched_entity     se;
> +       struct sched_statistics stats;
> +} __no_randomize_layout;
> +#endif
> +
>  /* Change a task's cfs_rq and parent entity if it moves across CPUs/groups */
>  static inline void set_task_rq(struct task_struct *p, unsigned int cpu)
>  {
> diff --git a/kernel/sched/stats.h b/kernel/sched/stats.h
> index a612cf253c87..ebe0a7765f98 100644
> --- a/kernel/sched/stats.h
> +++ b/kernel/sched/stats.h
> @@ -89,19 +89,12 @@ static inline void rq_sched_info_depart  (struct rq *rq, unsigned long long delt
>
>  #endif /* CONFIG_SCHEDSTATS */
>
> -#ifdef CONFIG_FAIR_GROUP_SCHED
> -struct sched_entity_stats {
> -       struct sched_entity     se;
> -       struct sched_statistics stats;
> -} __no_randomize_layout;
> -#endif
> -
>  static inline struct sched_statistics *
>  __schedstats_from_se(struct sched_entity *se)
>  {
>  #ifdef CONFIG_FAIR_GROUP_SCHED
>         if (!entity_is_task(se))
> -               return &container_of(se, struct sched_entity_stats, se)->stats;
> +               return &container_of(se, struct cfs_tg_state, se)->stats;
>  #endif
>         return &task_of(se)->stats;
>  }
> --
> 2.53.0
>

Reviewed-by: Josh Don <joshdon@google.com>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v9 RESEND 2/3] sched/fair: Remove task_group->se pointer array
  2026-03-19 17:52 ` [PATCH v9 RESEND 2/3] sched/fair: Remove task_group->se pointer array Zecheng Li
@ 2026-03-31 19:42   ` Josh Don
  0 siblings, 0 replies; 9+ messages in thread
From: Josh Don @ 2026-03-31 19:42 UTC (permalink / raw)
  To: Zecheng Li
  Cc: Ingo Molnar, Peter Zijlstra, Juri Lelli, Vincent Guittot,
	Dietmar Eggemann, Steven Rostedt, Ben Segall, Mel Gorman,
	Valentin Schneider, Rik van Riel, Chris Mason,
	Madadi Vineeth Reddy, Xu Liu, Blake Jones, Nilay Vaish,
	K Prateek Nayak, Andrew Morton, linux-kernel, Zecheng Li

Thanks Zecheng,

On Thu, Mar 19, 2026 at 10:52 AM Zecheng Li <zli94@ncsu.edu> wrote:
>
> From: Zecheng Li <zecheng@google.com>
>
> Now that struct sched_entity is co-located with struct cfs_rq for
> non-root task groups, the task_group->se pointer array is redundant. The
> associated sched_entity can be loaded directly from the cfs_rq.
>
> This patch performs the access conversion with the helpers:
>
> - is_root_task_group(tg): checks if a task group is the root task group.
> It compares the task group's address with the global root_task_group
> variable.
>
> - tg_se(tg, cpu): retrieves the cfs_rq and returns the address of the
> co-located se. This function checks if tg is the root task group to
> ensure behaving the same of previous tg->se[cpu]. Replaces all accesses
> that use the tg->se[cpu] pointer array with calls to the new tg_se(tg,
> cpu) accessor.
>
> - cfs_rq_se(cfs_rq): simplifies access paths like cfs_rq->tg->se[...] to
> use the co-located sched_entity. This function also checks if tg is the
> root task group to ensure same behavior.
>
> Since tg_se is not in very hot code paths, and the branch is a register
> comparison with an immediate value (`&root_task_group`), the performance
> impact is expected to be negligible.
>
> Signed-off-by: Zecheng Li <zecheng@google.com>
> Signed-off-by: Zecheng Li <zli94@ncsu.edu>
> Reviewed-by: K Prateek Nayak <kprateek.nayak@amd.com>
> ---
>  kernel/sched/core.c  |  7 ++-----
>  kernel/sched/debug.c |  2 +-
>  kernel/sched/fair.c  | 25 +++++++++----------------
>  kernel/sched/sched.h | 31 ++++++++++++++++++++++++++-----
>  4 files changed, 38 insertions(+), 27 deletions(-)
>
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index 64b467c1d5b6..2df42786f780 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -8609,7 +8609,7 @@ void __init sched_init(void)
>         wait_bit_init();
>
>  #ifdef CONFIG_FAIR_GROUP_SCHED
> -       ptr += 2 * nr_cpu_ids * sizeof(void **);
> +       ptr += nr_cpu_ids * sizeof(void **);
>  #endif
>  #ifdef CONFIG_RT_GROUP_SCHED
>         ptr += 2 * nr_cpu_ids * sizeof(void **);
> @@ -8618,9 +8618,6 @@ void __init sched_init(void)
>                 ptr = (unsigned long)kzalloc(ptr, GFP_NOWAIT);
>
>  #ifdef CONFIG_FAIR_GROUP_SCHED
> -               root_task_group.se = (struct sched_entity **)ptr;
> -               ptr += nr_cpu_ids * sizeof(void **);
> -
>                 root_task_group.cfs_rq = (struct cfs_rq **)ptr;
>                 ptr += nr_cpu_ids * sizeof(void **);
>
> @@ -9697,7 +9694,7 @@ static int cpu_cfs_stat_show(struct seq_file *sf, void *v)
>                 int i;
>
>                 for_each_possible_cpu(i) {
> -                       stats = __schedstats_from_se(tg->se[i]);
> +                       stats = __schedstats_from_se(tg_se(tg, i));
>                         ws += schedstat_val(stats->wait_sum);
>                 }
>
> diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c
> index 6246008c431e..7e7860d56b4b 100644
> --- a/kernel/sched/debug.c
> +++ b/kernel/sched/debug.c
> @@ -750,7 +750,7 @@ void dirty_sched_domain_sysctl(int cpu)
>  #ifdef CONFIG_FAIR_GROUP_SCHED
>  static void print_cfs_group_stats(struct seq_file *m, int cpu, struct task_group *tg)
>  {
> -       struct sched_entity *se = tg->se[cpu];
> +       struct sched_entity *se = tg_se(tg, cpu);
>
>  #define P(F)           SEQ_printf(m, "  .%-30s: %lld\n",       #F, (long long)F)
>  #define P_SCHEDSTAT(F) SEQ_printf(m, "  .%-30s: %lld\n",       \
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 79160d419c9f..c116e7c2b916 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -6212,7 +6212,7 @@ void unthrottle_cfs_rq(struct cfs_rq *cfs_rq)
>  {
>         struct rq *rq = rq_of(cfs_rq);
>         struct cfs_bandwidth *cfs_b = tg_cfs_bandwidth(cfs_rq->tg);
> -       struct sched_entity *se = cfs_rq->tg->se[cpu_of(rq)];
> +       struct sched_entity *se = cfs_rq_se(cfs_rq);
>
>         /*
>          * It's possible we are called with runtime_remaining < 0 due to things
> @@ -10067,7 +10067,6 @@ static bool __update_blocked_fair(struct rq *rq, bool *done)
>  {
>         struct cfs_rq *cfs_rq, *pos;
>         bool decayed = false;
> -       int cpu = cpu_of(rq);
>
>         /*
>          * Iterates the task_group tree in a bottom up fashion, see
> @@ -10087,7 +10086,7 @@ static bool __update_blocked_fair(struct rq *rq, bool *done)
>                 }
>
>                 /* Propagate pending load changes to the parent, if any: */
> -               se = cfs_rq->tg->se[cpu];
> +               se = cfs_rq_se(cfs_rq);
>                 if (se && !skip_blocked_update(se))
>                         update_load_avg(cfs_rq_of(se), se, UPDATE_TG);
>
> @@ -10113,8 +10112,7 @@ static bool __update_blocked_fair(struct rq *rq, bool *done)
>   */
>  static void update_cfs_rq_h_load(struct cfs_rq *cfs_rq)
>  {
> -       struct rq *rq = rq_of(cfs_rq);
> -       struct sched_entity *se = cfs_rq->tg->se[cpu_of(rq)];
> +       struct sched_entity *se = cfs_rq_se(cfs_rq);
>         unsigned long now = jiffies;
>         unsigned long load;
>
> @@ -13880,7 +13878,6 @@ void free_fair_sched_group(struct task_group *tg)
>         }
>
>         kfree(tg->cfs_rq);
> -       kfree(tg->se);
>  }
>
>  int alloc_fair_sched_group(struct task_group *tg, struct task_group *parent)
> @@ -13893,9 +13890,6 @@ int alloc_fair_sched_group(struct task_group *tg, struct task_group *parent)
>         tg->cfs_rq = kzalloc_objs(cfs_rq, nr_cpu_ids);
>         if (!tg->cfs_rq)
>                 goto err;
> -       tg->se = kzalloc_objs(se, nr_cpu_ids);
> -       if (!tg->se)
> -               goto err;
>
>         tg->shares = NICE_0_LOAD;
>
> @@ -13910,7 +13904,7 @@ int alloc_fair_sched_group(struct task_group *tg, struct task_group *parent)
>                 cfs_rq = &state->cfs_rq;
>                 se = &state->se;
>                 init_cfs_rq(cfs_rq);
> -               init_tg_cfs_entry(tg, cfs_rq, se, i, parent->se[i]);
> +               init_tg_cfs_entry(tg, cfs_rq, se, i, tg_se(parent, i));
>                 init_entity_runnable_average(se);
>         }
>
> @@ -13929,7 +13923,7 @@ void online_fair_sched_group(struct task_group *tg)
>
>         for_each_possible_cpu(i) {
>                 rq = cpu_rq(i);
> -               se = tg->se[i];
> +               se = tg_se(tg, i);
>                 rq_lock_irq(rq, &rf);
>                 update_rq_clock(rq);
>                 attach_entity_cfs_rq(se);
> @@ -13946,7 +13940,7 @@ void unregister_fair_sched_group(struct task_group *tg)
>
>         for_each_possible_cpu(cpu) {
>                 struct cfs_rq *cfs_rq = tg->cfs_rq[cpu];
> -               struct sched_entity *se = tg->se[cpu];
> +               struct sched_entity *se = tg_se(tg, cpu);
>                 struct rq *rq = cpu_rq(cpu);
>
>                 if (se) {
> @@ -13983,7 +13977,6 @@ void init_tg_cfs_entry(struct task_group *tg, struct cfs_rq *cfs_rq,
>         init_cfs_rq_runtime(cfs_rq);
>
>         tg->cfs_rq[cpu] = cfs_rq;
> -       tg->se[cpu] = se;
>
>         /* se could be NULL for root_task_group */
>         if (!se)
> @@ -14014,7 +14007,7 @@ static int __sched_group_set_shares(struct task_group *tg, unsigned long shares)
>         /*
>          * We can't change the weight of the root cgroup.
>          */
> -       if (!tg->se[0])
> +       if (is_root_task_group(tg))
>                 return -EINVAL;
>
>         shares = clamp(shares, scale_load(MIN_SHARES), scale_load(MAX_SHARES));
> @@ -14025,7 +14018,7 @@ static int __sched_group_set_shares(struct task_group *tg, unsigned long shares)
>         tg->shares = shares;
>         for_each_possible_cpu(i) {
>                 struct rq *rq = cpu_rq(i);
> -               struct sched_entity *se = tg->se[i];
> +               struct sched_entity *se = tg_se(tg, i);
>                 struct rq_flags rf;
>
>                 /* Propagate contribution to hierarchy */
> @@ -14076,7 +14069,7 @@ int sched_group_set_idle(struct task_group *tg, long idle)
>
>         for_each_possible_cpu(i) {
>                 struct rq *rq = cpu_rq(i);
> -               struct sched_entity *se = tg->se[i];
> +               struct sched_entity *se = tg_se(tg, i);
>                 struct cfs_rq *grp_cfs_rq = tg->cfs_rq[i];
>                 bool was_idle = cfs_rq_is_idle(grp_cfs_rq);
>                 long idle_task_delta;
> diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
> index 826f21fa3f36..258dc689a535 100644
> --- a/kernel/sched/sched.h
> +++ b/kernel/sched/sched.h
> @@ -480,8 +480,6 @@ struct task_group {
>  #endif
>
>  #ifdef CONFIG_FAIR_GROUP_SCHED
> -       /* schedulable entities of this group on each CPU */
> -       struct sched_entity     **se;
>         /* runqueue "owned" by this group on each CPU */
>         struct cfs_rq           **cfs_rq;
>         unsigned long           shares;
> @@ -920,7 +918,8 @@ struct dl_rq {
>  };
>
>  #ifdef CONFIG_FAIR_GROUP_SCHED
> -
> +/* Check whether a task group is root tg */
> +#define is_root_task_group(tg) ((tg) == &root_task_group)
>  /* An entity is a task if it doesn't "own" a runqueue */
>  #define entity_is_task(se)     (!se->my_q)
>
> @@ -2259,6 +2258,28 @@ struct cfs_tg_state {
>         struct sched_entity     se;
>         struct sched_statistics stats;
>  } __no_randomize_layout;
> +
> +static inline struct sched_entity *tg_se(struct task_group *tg, int cpu)
> +{
> +       struct cfs_tg_state *state;
> +
> +       if (is_root_task_group(tg))
> +               return NULL;
> +
> +       state = container_of(tg->cfs_rq[cpu], struct cfs_tg_state, cfs_rq);
> +       return &state->se;
> +}
> +
> +static inline struct sched_entity *cfs_rq_se(struct cfs_rq *cfs_rq)
> +{
> +       struct cfs_tg_state *state;
> +
> +       if (is_root_task_group(cfs_rq->tg))
> +               return NULL;
> +
> +       state = container_of(cfs_rq, struct cfs_tg_state, cfs_rq);
> +       return &state->se;
> +}
>  #endif
>
>  /* Change a task's cfs_rq and parent entity if it moves across CPUs/groups */
> @@ -2271,8 +2292,8 @@ static inline void set_task_rq(struct task_struct *p, unsigned int cpu)
>  #ifdef CONFIG_FAIR_GROUP_SCHED
>         set_task_rq_fair(&p->se, p->se.cfs_rq, tg->cfs_rq[cpu]);
>         p->se.cfs_rq = tg->cfs_rq[cpu];
> -       p->se.parent = tg->se[cpu];
> -       p->se.depth = tg->se[cpu] ? tg->se[cpu]->depth + 1 : 0;
> +       p->se.parent = tg_se(tg, cpu);
> +       p->se.depth = p->se.parent ? p->se.parent->depth + 1 : 0;
>  #endif
>
>  #ifdef CONFIG_RT_GROUP_SCHED
> --
> 2.53.0
>

Reviewed-by: Josh Don <joshdon@google.com>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v9 RESEND 3/3] sched/fair: Allocate cfs_tg_state with percpu allocator
  2026-03-19 17:52 ` [PATCH v9 RESEND 3/3] sched/fair: Allocate cfs_tg_state with percpu allocator Zecheng Li
@ 2026-03-31 19:49   ` Josh Don
  0 siblings, 0 replies; 9+ messages in thread
From: Josh Don @ 2026-03-31 19:49 UTC (permalink / raw)
  To: Zecheng Li
  Cc: Ingo Molnar, Peter Zijlstra, Juri Lelli, Vincent Guittot,
	Dietmar Eggemann, Steven Rostedt, Ben Segall, Mel Gorman,
	Valentin Schneider, Rik van Riel, Chris Mason,
	Madadi Vineeth Reddy, Xu Liu, Blake Jones, Nilay Vaish,
	K Prateek Nayak, Andrew Morton, linux-kernel, Zecheng Li

On Thu, Mar 19, 2026 at 10:52 AM Zecheng Li <zli94@ncsu.edu> wrote:
>
> From: Zecheng Li <zecheng@google.com>
>
> To remove the cfs_rq pointer array in task_group, allocate the combined
> cfs_rq and sched_entity using the per-cpu allocator.
>
> This patch implements the following:
>
> - Changes task_group->cfs_rq from struct cfs_rq ** to struct cfs_rq
> __percpu *.
>
> - Updates memory allocation in alloc_fair_sched_group() and
> free_fair_sched_group() to use alloc_percpu() and free_percpu()
> respectively.
>
> - Uses the inline accessor tg_cfs_rq(tg, cpu) with per_cpu_ptr() to
> retrieve the pointer to cfs_rq for the given task group and CPU.
>
> - Replaces direct accesses tg->cfs_rq[cpu] with calls to the new
> tg_cfs_rq(tg, cpu) helper.
>
> - Handles the root_task_group: since struct rq is already a per-cpu
> variable (runqueues), its embedded cfs_rq (rq->cfs) is also per-cpu.
> Therefore, we assign root_task_group.cfs_rq = &runqueues.cfs.
>
> - Cleanup the code in initializing the root task group.
>
> This change places each CPU's cfs_rq and sched_entity in its local
> per-cpu memory area to remove the per-task_group pointer arrays.
>
> Signed-off-by: Zecheng Li <zecheng@google.com>
> Signed-off-by: Zecheng Li <zli94@ncsu.edu>
> Reviewed-by: K Prateek Nayak <kprateek.nayak@amd.com>
> ---
>  kernel/sched/core.c  | 35 +++++++++++-----------------
>  kernel/sched/fair.c  | 54 ++++++++++++++++++--------------------------
>  kernel/sched/sched.h | 14 ++++++++----
>  3 files changed, 45 insertions(+), 58 deletions(-)

Reviewed-by: Josh Don <joshdon@google.com>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v9 RESEND 1/3] sched/fair: Co-locate cfs_rq and sched_entity in cfs_tg_state
  2026-03-31 19:35   ` Josh Don
@ 2026-04-01  2:57     ` K Prateek Nayak
  2026-04-02  2:19       ` Josh Don
  0 siblings, 1 reply; 9+ messages in thread
From: K Prateek Nayak @ 2026-04-01  2:57 UTC (permalink / raw)
  To: Josh Don, Zecheng Li
  Cc: Ingo Molnar, Peter Zijlstra, Juri Lelli, Vincent Guittot,
	Dietmar Eggemann, Steven Rostedt, Ben Segall, Mel Gorman,
	Valentin Schneider, Rik van Riel, Chris Mason,
	Madadi Vineeth Reddy, Xu Liu, Blake Jones, Nilay Vaish,
	Andrew Morton, linux-kernel, Zecheng Li

Hello Josh,

On 4/1/2026 1:05 AM, Josh Don wrote:
>> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
>> index 0a35a82e4792..79160d419c9f 100644
>> --- a/kernel/sched/fair.c
>> +++ b/kernel/sched/fair.c
>> @@ -13877,8 +13877,6 @@ void free_fair_sched_group(struct task_group *tg)
>>         for_each_possible_cpu(i) {
>>                 if (tg->cfs_rq)
>>                         kfree(tg->cfs_rq[i]);
>> -               if (tg->se)
>> -                       kfree(tg->se[i]);
>>         }
> 
> To be more explicit, suggest converting tg->cfs_rq[i] to an explicit
> cfs_tg_state pointer via container_of, to not depend on cfs_rq being
> the first member of the struct.

I suggested the __no_randomize_layout trick since it is similar to what
"struct sched_entity_stats" does and we save on checking if
"tg->cfs_rq[i]" NULL before doing container_of() + kfree().

I isn't any more obscure than how kfree(tg->se[i]) would have previously
freed up the stats member too in one go but perhaps a comment on top
can address your concerns?

-- 
Thanks and Regards,
Prateek


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v9 RESEND 1/3] sched/fair: Co-locate cfs_rq and sched_entity in cfs_tg_state
  2026-04-01  2:57     ` K Prateek Nayak
@ 2026-04-02  2:19       ` Josh Don
  0 siblings, 0 replies; 9+ messages in thread
From: Josh Don @ 2026-04-02  2:19 UTC (permalink / raw)
  To: K Prateek Nayak
  Cc: Zecheng Li, Ingo Molnar, Peter Zijlstra, Juri Lelli,
	Vincent Guittot, Dietmar Eggemann, Steven Rostedt, Ben Segall,
	Mel Gorman, Valentin Schneider, Rik van Riel, Chris Mason,
	Madadi Vineeth Reddy, Xu Liu, Blake Jones, Nilay Vaish,
	Andrew Morton, linux-kernel, Zecheng Li

On Tue, Mar 31, 2026 at 7:58 PM K Prateek Nayak <kprateek.nayak@amd.com> wrote:
>
> Hello Josh,
>
> On 4/1/2026 1:05 AM, Josh Don wrote:
> >> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> >> index 0a35a82e4792..79160d419c9f 100644
> >> --- a/kernel/sched/fair.c
> >> +++ b/kernel/sched/fair.c
> >> @@ -13877,8 +13877,6 @@ void free_fair_sched_group(struct task_group *tg)
> >>         for_each_possible_cpu(i) {
> >>                 if (tg->cfs_rq)
> >>                         kfree(tg->cfs_rq[i]);
> >> -               if (tg->se)
> >> -                       kfree(tg->se[i]);
> >>         }
> >
> > To be more explicit, suggest converting tg->cfs_rq[i] to an explicit
> > cfs_tg_state pointer via container_of, to not depend on cfs_rq being
> > the first member of the struct.
>
> I suggested the __no_randomize_layout trick since it is similar to what
> "struct sched_entity_stats" does and we save on checking if
> "tg->cfs_rq[i]" NULL before doing container_of() + kfree().
>
> I isn't any more obscure than how kfree(tg->se[i]) would have previously
> freed up the stats member too in one go but perhaps a comment on top
> can address your concerns?

This isn't a hot path that requires optimizing to that level, we're
talking about cgroup free here :)

The downside of the current approach is the brittleness of requiring
the field be the very first member of the struct +
no_randomize_layout. At minimum that needs a comment, but again I
struggle to see the justification for the complexity.

Up to Peter, but at minimum I think we need a comment on the struct if
we keep it as-is.

>
> --
> Thanks and Regards,
> Prateek
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-04-02  2:19 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-03-19 17:52 [PATCH v9 RESEND 0/3] sched/fair: Optimize cfs_rq and sched_entity allocation for better data locality Zecheng Li
2026-03-19 17:52 ` [PATCH v9 RESEND 1/3] sched/fair: Co-locate cfs_rq and sched_entity in cfs_tg_state Zecheng Li
2026-03-31 19:35   ` Josh Don
2026-04-01  2:57     ` K Prateek Nayak
2026-04-02  2:19       ` Josh Don
2026-03-19 17:52 ` [PATCH v9 RESEND 2/3] sched/fair: Remove task_group->se pointer array Zecheng Li
2026-03-31 19:42   ` Josh Don
2026-03-19 17:52 ` [PATCH v9 RESEND 3/3] sched/fair: Allocate cfs_tg_state with percpu allocator Zecheng Li
2026-03-31 19:49   ` Josh Don

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®