From: K Prateek Nayak <kprateek.nayak@amd.com>
To: Zecheng Li <zli94@ncsu.edu>, Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Juri Lelli <juri.lelli@redhat.com>,
Vincent Guittot <vincent.guittot@linaro.org>
Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>,
Steven Rostedt <rostedt@goodmis.org>,
Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
Valentin Schneider <vschneid@redhat.com>,
Rik van Riel <riel@surriel.com>, Chris Mason <clm@fb.com>,
Madadi Vineeth Reddy <vineethr@linux.ibm.com>,
Xu Liu <xliuprof@google.com>, Blake Jones <blakejones@google.com>,
Josh Don <joshdon@google.com>,
Nilay Vaish <nilayvaish@google.com>,
<linux-kernel@vger.kernel.org>, Zecheng Li <zecheng@google.com>
Subject: Re: [PATCH v7 1/3] sched/fair: Co-locate cfs_rq and sched_entity in cfs_tg_state
Date: Mon, 19 Jan 2026 12:10:57 +0530 [thread overview]
Message-ID: <814a7bca-c5c7-446f-a67a-c09dab397f9b@amd.com> (raw)
In-Reply-To: <20260118033431.158464-2-zli94@ncsu.edu>
Hello Zecheng,
On 1/18/2026 9:04 AM, Zecheng Li wrote:
> @@ -13617,10 +13617,11 @@ 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]);
> - if (tg->se)
> - kfree(tg->se[i]);
> + if (tg->cfs_rq && tg->cfs_rq[i]) {
nit. Since the cfs_tg_state uses __no_randomize_layout now and, "cfs_rq"
is the first member, you can just do kfree(tg->cfs_rq[i]) since it is
the beginning of cfs_tg_state too.
This is how kfree() on tg->se[i] would have freed the entire
"sched_entity_stats" previously.
I know this is a transient change since later you switch to using
free_percpu() but it would still be nice to have a simplified hunk here.
> + struct cfs_tg_state *state =
> + container_of(tg->cfs_rq[i], struct cfs_tg_state, cfs_rq);
> + kfree(state);
> + }
> }
>
> kfree(tg->cfs_rq);
--
Thanks and Regards,
Prateek
next prev parent reply other threads:[~2026-01-19 6:41 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-18 3:34 [PATCH v7 0/3] sched/fair: Optimize cfs_rq and sched_entity allocation for better data locality Zecheng Li
2026-01-18 3:34 ` [PATCH v7 1/3] sched/fair: Co-locate cfs_rq and sched_entity in cfs_tg_state Zecheng Li
2026-01-19 6:40 ` K Prateek Nayak [this message]
2026-01-18 3:34 ` [PATCH v7 2/3] sched/fair: Remove task_group->se pointer array Zecheng Li
2026-01-19 6:43 ` K Prateek Nayak
2026-01-18 3:34 ` [PATCH v7 3/3] sched/fair: Allocate both cfs_tg_state with percpu allocator Zecheng Li
2026-01-19 7:17 ` K Prateek Nayak
2026-01-20 19:11 ` Zecheng Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=814a7bca-c5c7-446f-a67a-c09dab397f9b@amd.com \
--to=kprateek.nayak@amd.com \
--cc=blakejones@google.com \
--cc=bsegall@google.com \
--cc=clm@fb.com \
--cc=dietmar.eggemann@arm.com \
--cc=joshdon@google.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=nilayvaish@google.com \
--cc=peterz@infradead.org \
--cc=riel@surriel.com \
--cc=rostedt@goodmis.org \
--cc=vincent.guittot@linaro.org \
--cc=vineethr@linux.ibm.com \
--cc=vschneid@redhat.com \
--cc=xliuprof@google.com \
--cc=zecheng@google.com \
--cc=zli94@ncsu.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome