Sched_ext development
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Cheng-Yang Chou <yphbchou0911@gmail.com>
Cc: sched-ext@lists.linux.dev, David Vernet <void@manifault.com>,
	Andrea Righi <arighi@nvidia.com>,
	Changwoo Min <changwoo@igalia.com>,
	Kuba Piecuch <jpiecuch@google.com>,
	Ching-Chun Huang <jserv@ccns.ncku.edu.tw>,
	Chia-Ping Tsai <chia7712@gmail.com>
Subject: Re: [PATCH v2 sched_ext/for-7.2 0/2] sched_ext: Add cookie API for early qseq capture
Date: Fri, 08 May 2026 08:51:04 -1000	[thread overview]
Message-ID: <940c9ebdfaf50745dc5a310e3942b2bc@kernel.org> (raw)
In-Reply-To: <20260506160412.522199-1-yphbchou0911@gmail.com>

Hello, Cheng-Yang.

The cookie/qseq vocabulary leaks the implementation. The API is
really a dispatch transaction where commit fails if the task is no
longer ours to dispatch (dequeued, or claimed by someone else).
Naming along those lines would describe what the API does, e.g.:

  scx_bpf_dsq_insert_begin(p)              -> u64 cookie
  scx_bpf_dsq_insert_commit(p, dsq_id, enq_flags, cookie)

The internal scx_dsq_insert_commit() helper would need a rename.
The kdoc can then describe the transaction directly without
referring to qseq or ops_state.

For the selftest: the BPF program calls insert from ops.enqueue(),
which goes through mark_direct_dispatch() and never stages an entry
in the dispatch buffer. The cookie is silently ignored. The test
would still pass if patch 1/2 stored 0 in place of the cookie. To
actually exercise the race-detection window, the insert needs to
happen from ops.dispatch() with something invalidating the task in
between (e.g. an affinity flip).

Thanks.

--
tejun

      parent reply	other threads:[~2026-05-08 18:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-06 16:04 [PATCH v2 sched_ext/for-7.2 0/2] sched_ext: Add cookie API for early qseq capture Cheng-Yang Chou
2026-05-06 16:04 ` [PATCH v2 1/2] " Cheng-Yang Chou
2026-05-06 20:34   ` sashiko-bot
2026-05-06 16:04 ` [PATCH v2 2/2] selftests/sched_ext: Add dispatch_cookie test Cheng-Yang Chou
2026-05-06 20:52   ` sashiko-bot
2026-05-07 10:43     ` Cheng-Yang Chou
2026-05-08 18:51 ` 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=940c9ebdfaf50745dc5a310e3942b2bc@kernel.org \
    --to=tj@kernel.org \
    --cc=arighi@nvidia.com \
    --cc=changwoo@igalia.com \
    --cc=chia7712@gmail.com \
    --cc=jpiecuch@google.com \
    --cc=jserv@ccns.ncku.edu.tw \
    --cc=sched-ext@lists.linux.dev \
    --cc=void@manifault.com \
    --cc=yphbchou0911@gmail.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