mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: sched-ext@lists.linux.dev
Cc: David Vernet <void@manifault.com>,
	Andrea Righi <arighi@nvidia.com>,
	Changwoo Min <changwoo@igalia.com>,
	Emil Tsalapatis <emil@etsalapatis.com>,
	David Dai <david.dai@linux.dev>,
	linux-kernel@vger.kernel.org, Tejun Heo <tj@kernel.org>
Subject: [PATCH sched_ext/for-7.4-fixes] sched_ext: Fix scx_bpf_dsq_reenq() kerneldoc claiming NMI calls are allowed
Date: Thu, 29 Oct 2026 13:52:51 -1000	[thread overview]
Message-ID: <20261029235251.3235814-1-tj@kernel.org> (raw)

c659e506f9a7 ("sched_ext: Reject NMI calls to lock-taking kfuncs") made
scx_bpf_dsq_reenq() abort the scheduler when called from NMI. The kerneldocs
of scx_bpf_dsq_reenq() and of its wrapper scx_bpf_reenqueue_local___v2()
still say the kfuncs can be called from anywhere. Update both to exclude
NMI.

While at it, fix the wrapper's kerneldoc, which says it re-enqueues the
calling CPU's local DSQ rather than the one SCX_DSQ_LOCAL resolves to, and
the SCX_RENQ_* typo in the scx_bpf_dsq_reenq() kerneldoc.

Signed-off-by: Tejun Heo <tj@kernel.org>
---
 kernel/sched/ext/ext.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/kernel/sched/ext/ext.c b/kernel/sched/ext/ext.c
index 15123f181b5b..cd923f9f1f2a 100644
--- a/kernel/sched/ext/ext.c
+++ b/kernel/sched/ext/ext.c
@@ -11115,7 +11115,7 @@ __bpf_kfunc struct task_struct *scx_bpf_dsq_peek(u64 dsq_id,
 /**
  * scx_bpf_dsq_reenq - Re-enqueue tasks on a DSQ
  * @dsq_id: DSQ to re-enqueue
- * @reenq_flags: %SCX_RENQ_*
+ * @reenq_flags: %SCX_REENQ_*
  * @aux: implicit BPF argument to access bpf_prog_aux hidden from BPF progs
  *
  * Iterate over all of the tasks currently enqueued on the DSQ identified by
@@ -11125,8 +11125,9 @@ __bpf_kfunc struct task_struct *scx_bpf_dsq_peek(u64 dsq_id,
  * - Local DSQs (%SCX_DSQ_LOCAL or %SCX_DSQ_LOCAL_ON | $cpu)
  * - User DSQs
  *
- * Re-enqueues are performed asynchronously. Can be called from anywhere. A
- * re-enqueue of an inactive cpu's local DSQ is ignored.
+ * Re-enqueues are performed asynchronously. Can be called from any context
+ * except NMI. A call from NMI aborts the scheduler. A re-enqueue of an inactive
+ * cpu's local DSQ is ignored.
  *
  * %SCX_DSQ_LOCAL resolves to the local DSQ of the rq the current scheduler
  * operation is locked to - e.g. the rq being dispatched for in ops.dispatch() -
@@ -11223,9 +11224,10 @@ __bpf_kfunc bool scx_bpf_dsq_reenq_task(struct bpf_iter_scx_dsq *it__iter,
  * scx_bpf_reenqueue_local___v2 - Re-enqueue tasks on a local DSQ
  * @aux: implicit BPF argument to access bpf_prog_aux hidden from BPF progs
  *
- * Iterate over all of the tasks currently enqueued on the local DSQ of the
- * caller's CPU, and re-enqueue them in the BPF scheduler. Can be called from
- * anywhere.
+ * Iterate over all of the tasks currently enqueued on the local DSQ of the rq
+ * the current scheduler operation is locked to, or the calling CPU's when no rq
+ * is locked, and re-enqueue them in the BPF scheduler. Can be called from any
+ * context except NMI. A call from NMI aborts the scheduler.
  *
  * This is now a special case of scx_bpf_dsq_reenq() and may be removed in the
  * future.
-- 
2.56.0


             reply	other threads:[~2026-10-29 23:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-29 23:52 Tejun Heo [this message]
2026-10-30  6:11 ` Andrea Righi

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=20261029235251.3235814-1-tj@kernel.org \
    --to=tj@kernel.org \
    --cc=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=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®