From: Tejun Heo <tj@kernel.org>
To: David Carlier <devnexen@gmail.com>
Cc: David Vernet <void@manifault.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sched_ext: Separate lock and first_task into distinct cache lines in scx_dispatch_q
Date: Sat, 28 Feb 2026 07:28:00 -1000 [thread overview]
Message-ID: <aaMloFh4g0oQaXXd@slm.duckdns.org> (raw)
In-Reply-To: <20260228130647.87606-1-devnexen@gmail.com>
On Sat, Feb 28, 2026 at 01:06:47PM +0000, David Carlier wrote:
> lock (write-heavy) and first_task (read-mostly, lockless RCU peek) share
> the same cache line in struct scx_dispatch_q. Every lock acquire/release
> by a dispatching CPU invalidates the line for all CPUs performing
> lockless first_task peeks, causing unnecessary cache coherence traffic,
> especially across NUMA nodes.
>
> Add ____cacheline_aligned_in_smp to first_task to place it on its own
> cache line, eliminating this false sharing on SMP systems. On
> uniprocessor builds the annotation is a no-op, so no space is wasted.
>
> On SMP, the trade-off is increased struct size: each scx_dispatch_q
> grows by up to ~56 bytes of padding. There are two instances embedded
> per-CPU in scx_rq (local_dsq and bypass_dsq), plus any dynamically
> allocated custom DSQs, so the total overhead scales with the number of
> CPUs and active DSQs.
But first_task is read-mostly. How could it be? David, from now on, I'm not
going to apply these patches unless you provide backing experimental data.
Thanks.
--
tejun
next prev parent reply other threads:[~2026-02-28 17:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-28 13:06 David Carlier
2026-02-28 17:28 ` Tejun Heo [this message]
2026-02-28 18:26 ` David CARLIER
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=aaMloFh4g0oQaXXd@slm.duckdns.org \
--to=tj@kernel.org \
--cc=devnexen@gmail.com \
--cc=linux-kernel@vger.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®