From: Tejun Heo <tj@kernel.org>
To: Kuba Piecuch <jpiecuch@google.com>
Cc: Andrea Righi <arighi@nvidia.com>,
Changwoo Min <changwoo@igalia.com>,
David Vernet <void@manifault.com>,
linux-kernel@vger.kernel.org, sched-ext@lists.linux.dev
Subject: Re: [PATCH sched_ext/for-7.3-fixes] sched_ext: Generate qseq from a per-task counter
Date: Fri, 02 Oct 2026 12:33:27 -1000 [thread overview]
Message-ID: <86a16fc6ea0a57cea7459ac2ebfdfc1b@kernel.org> (raw)
In-Reply-To: <20261002205242.3820674-1-jpiecuch@google.com>
Hello, Kuba.
On Fri, Oct 02, 2026 at 08:52:41PM +0000, Kuba Piecuch wrote:
> + do {
> + p->scx.ops_qseq++;
> + qseq = (unsigned long)p->scx.ops_qseq << SCX_OPSS_QSEQ_SHIFT;
> + } while (unlikely(!qseq));
Maybe wrap the counter where the QSEQ field wraps instead of looping?
p->scx.ops_qseq = ((p->scx.ops_qseq + 1) &
(SCX_OPSS_QSEQ_MASK >> SCX_OPSS_QSEQ_SHIFT)) ?: 1;
qseq = (unsigned long)p->scx.ops_qseq << SCX_OPSS_QSEQ_SHIFT;
On 32bit, the shift drops the top two bits of the counter, so the mask is
what keeps the counter from reaching a value that shifts to 0.
Thanks.
--
tejun
next prev parent reply other threads:[~2026-10-02 22:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-02 20:52 Kuba Piecuch
2026-10-02 22:33 ` Tejun Heo [this message]
2026-10-03 11:38 ` Kuba Piecuch
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=86a16fc6ea0a57cea7459ac2ebfdfc1b@kernel.org \
--to=tj@kernel.org \
--cc=arighi@nvidia.com \
--cc=changwoo@igalia.com \
--cc=jpiecuch@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sched-ext@lists.linux.dev \
--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®