From: Tejun Heo <tj@kernel.org>
To: Zhang Qiao <zhangqiao22@huawei.com>
Cc: sched-ext@lists.linux.dev, linux-kernel@vger.kernel.org,
void@manifault.com, arighi@nvidia.com, changwoo@igalia.com,
tanghui22@huawei.com
Subject: Re: [PATCH 0/4] sched_ext: Decompose scx_cid_init()
Date: Thu, 05 Nov 2026 07:10:00 -1000 [thread overview]
Message-ID: <08f0886ea1c48eed84bf6aadcf921530@kernel.org> (raw)
In-Reply-To: <20261105065013.784398-1-zhangqiao22@huawei.com>
Hello,
On Thu, Nov 05, 2026 at 02:50:09PM +0800, Zhang Qiao wrote:
> scx_cid_init() grew into a ~230-line monolith interleaving table
> allocation, the node/LLC/cluster/core topology walk, the no-topo tail
> and the shard range finalization.
I don't think the refactoring makes anything better. If anything, the
result seems more complicated than the current code.
A function being long isn't an automatic reason to refactor it.
scx_cid_init() is a linear sequence of steps that each run once:
allocate the tables and masks, walk the online CPUs node by node, assign
cids to the CPUs left without topology, warn about fallbacks, fill the
shard ranges.
The current code reads top to bottom, and splitting it into
single-caller helpers doesn't make any step simpler. It just adds call
boundaries and a builder struct whose only job is to carry the counters
and masks across them, so the reader has to jump around to follow one
sequence.
> No behavior change: WARN checks, error paths, shard policy and
> publication timing are all preserved. This is preparation for
> follow-up fixes to the partial-SMT core counting in
> calc_shard_layout() and the single-core shard hard-cap corner case,
> which are deliberately kept out to keep this series a pure code
> motion.
Can you please send the fixes separately?
Thanks.
--
tejun
prev parent reply other threads:[~2026-11-05 17:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-05 6:50 Zhang Qiao
2026-11-05 6:50 ` [PATCH 1/4] sched_ext: Extract no-topology CID construction and table finalization Zhang Qiao
2026-11-05 6:50 ` [PATCH 2/4] sched_ext: Collect CID construction state in a private builder Zhang Qiao
2026-11-05 6:50 ` [PATCH 3/4] sched_ext: Extract construction of a single LLC CID range Zhang Qiao
2026-11-05 6:50 ` [PATCH 4/4] sched_ext: Extract online CID construction from scx_cid_init Zhang Qiao
2026-11-05 17:10 ` Tejun Heo [this message]
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=08f0886ea1c48eed84bf6aadcf921530@kernel.org \
--to=tj@kernel.org \
--cc=arighi@nvidia.com \
--cc=changwoo@igalia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sched-ext@lists.linux.dev \
--cc=tanghui22@huawei.com \
--cc=void@manifault.com \
--cc=zhangqiao22@huawei.com \
/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
all inboxes | Powered by JetHome®