mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrea Righi <arighi@nvidia.com>
To: Tejun Heo <tj@kernel.org>
Cc: David Vernet <void@manifault.com>,
	Changwoo Min <changwoo@igalia.com>,
	Emil Tsalapatis <emil@etsalapatis.com>,
	David Dai <david.dai@linux.dev>,
	sched-ext@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH sched_ext/for-7.4] sched_ext: cid: Represent clusters explicitly
Date: Sat, 26 Sep 2026 21:58:37 +0200	[thread overview]
Message-ID: <argj7cXsK8WL6X0D@gpd4> (raw)
In-Reply-To: <23db458c1526966f521d41322ab47056@kernel.org>

Hi Tejun,

On Sat, Sep 26, 2026 at 09:23:15AM -1000, Tejun Heo wrote:
> Hello, Andrea.
> 
> On Sat, Sep 26, 2026 at 05:23:06PM +0200, Andrea Righi wrote:
> >  - set @cluster_cid to the LLC's own CID when no cluster level exists,
> >  - set @cluster_idx to -1 when no cluster level exists,
> 
> The other levels are inclusive: a level that doesn't exist for a cpu is
> represented by the level below it, the way a core on a non-SMT machine is
> just the cpu. Can we do the same here? A core without a cluster level is
> its own cluster, cluster_cid = core_cid with a dense cluster_idx. Then
> every cluster is a contiguous cid range, cluster_idx indexes per-cluster
> arrays without a -1 special case, and cluster_cid can't alias between a
> real cluster and the fallback cpus in the same LLC.

Makes sense, I'll change the fallback so each such core is its own cluster with
cluster_cid = core_cid and a dense cluster_idx.

> 
> > +	s32 cluster_cid;
> > +	s32 cluster_idx;
> 
> Growing struct scx_cid_topo breaks existing binaries: scx_bpf_cid_topo()
> copies out the kernel's sizeof into a buffer the program sized from its
> own vmlinux.h. I'm changing the kfunc to take the buffer size and copy the
> smaller of the two, filling the rest with -1, and routing that through
> for-7.3-fixes so that it lands before any growth. Can you base the next
> version on top of it and append the new fields at the end of the struct?

Yes, I'll send a new version on top of your fix (already reviewed) and keep the
new fields at the end.

There's also a comment from Sashiko about dropping __uninit, but it looks like a
false positive to me, the current verifier checks the out buffer for read access
even with that suffix, so restoring it would not change whether an uninitialized
stack buffer is accepted.

Thanks,
-Andrea

      reply	other threads:[~2026-09-26 19:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-26 15:23 Andrea Righi
2026-09-26 19:23 ` Tejun Heo
2026-09-26 19:58   ` Andrea Righi [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=argj7cXsK8WL6X0D@gpd4 \
    --to=arighi@nvidia.com \
    --cc=changwoo@igalia.com \
    --cc=david.dai@linux.dev \
    --cc=emil@etsalapatis.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sched-ext@lists.linux.dev \
    --cc=tj@kernel.org \
    --cc=void@manifault.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®