From: sashiko-bot@kernel.org
To: "Andrea Righi" <arighi@nvidia.com>
Cc: sched-ext@lists.linux.dev
Subject: Re: [PATCH 1/2] sched_ext: Add lazy preemption support
Date: Mon, 14 Sep 2026 09:06:40 +0000 [thread overview]
Message-ID: <20260914090640.A47A81F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260914084955.1798562-2-arighi@nvidia.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Calling update_rq_clock(rq) inside scx_resched_curr_lazy() triggers a WARN_DOUBLE_CLOCK warning because the runqueue clock has already been updated in the calling contexts.
--
commit 6fc03e981449ffc8b39d02362a88e51ad755b27e
Author: Andrea Righi <arighi@nvidia.com>
sched_ext: Add lazy preemption support
The fair scheduling class can request lazy rescheduling, deferring an
in-kernel scheduling boundary until returning to user space or until the
next scheduler tick. sched_ext only exposes immediate preemption,
preventing BPF schedulers from making the same trade-off.
> diff --git a/kernel/sched/ext/ext.c b/kernel/sched/ext/ext.c
> index 11114a6daf387..6d39f715196dc 100644
> --- a/kernel/sched/ext/ext.c
> +++ b/kernel/sched/ext/ext.c
[ ... ]
> @@ -1515,6 +1515,23 @@ static void call_task_dequeue(struct scx_sched *sch, struct rq *rq,
> p->scx.flags &= ~SCX_TASK_IN_CUSTODY;
> }
>
> +/*
> + * A task with an infinite slice may be running with its tick stopped. Lazy
> + * rescheduling doesn't send an IPI, so restore the tick dependency first to
> + * guarantee that the lazy request is promoted by a real scheduler tick.
> + */
> +static void scx_resched_curr_lazy(struct rq *rq)
> +{
> + if (rq->scx.flags & SCX_RQ_CAN_STOP_TICK) {
> + rq->scx.flags &= ~SCX_RQ_CAN_STOP_TICK;
> + update_rq_clock(rq);
> + update_other_load_avgs(rq);
[Severity: Medium]
Does this trigger a SCHED_WARN_ON(rq->clock_update_flags & RQCF_UPDATED)
double-clock update warning?
It looks like update_rq_clock() can be called from paths where the clock
has already been updated or the rq lock was taken without pinning.
For example, during a task enqueue, enqueue_task() updates the clock and
sets RQCF_UPDATED. The call chain then reaches rq_owned_post_enq() ->
scx_resched_curr_lazy(), calling update_rq_clock() while RQCF_UPDATED is
still set.
It also appears reachable via kick_one_cpu(), which acquires the runqueue
lock using raw_spin_rq_lock_irqsave() rather than rq_pin_lock(). This means
RQCF_UPDATED is not cleared from the previous lock hold, and calling
scx_resched_curr_lazy() here updates the clock without a valid pin context.
> + sched_update_tick_dependency(rq);
> + }
> +
> + resched_curr_lazy(rq);
> +}
> +
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260914084955.1798562-1-arighi@nvidia.com?part=1
next prev parent reply other threads:[~2026-09-14 9:06 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-14 8:47 [PATCHSET v2 sched_ext/for-7.4] sched_ext: Add lazy preemption support Andrea Righi
2026-09-14 8:47 ` [PATCH 1/2] " Andrea Righi
2026-09-14 9:06 ` sashiko-bot [this message]
2026-09-14 12:18 ` Andrea Righi
2026-09-14 8:47 ` [PATCH 2/2] selftests/sched_ext: Add lazy preemption tests Andrea Righi
2026-09-14 9:01 ` sashiko-bot
2026-09-14 12:21 ` Andrea Righi
2026-09-14 14:55 ` Cheng-Yang Chou
2026-09-15 13:35 ` Andrea Righi
-- strict thread matches above, loose matches on Subject: below --
2026-09-18 17:13 [PATCHSET v7 sched_ext/for-7.4] sched_ext: Add lazy preemption support Andrea Righi
2026-09-18 17:13 ` [PATCH 1/2] " Andrea Righi
2026-09-17 7:02 [PATCHSET v6 sched_ext/for-7.4] " Andrea Righi
2026-09-17 7:02 ` [PATCH 1/2] " Andrea Righi
2026-09-17 19:19 ` Tejun Heo
2026-09-18 6:27 ` Andrea Righi
2026-09-18 3:35 ` Tao Cui
2026-09-18 6:37 ` Andrea Righi
2026-09-15 19:45 [PATCHSET v5 sched_ext/for-7.4] " Andrea Righi
2026-09-15 19:45 ` [PATCH 1/2] " Andrea Righi
2026-09-15 19:57 ` sashiko-bot
2026-09-15 20:09 ` Andrea Righi
2026-09-16 21:03 ` Tejun Heo
2026-09-15 9:00 [PATCHSET v4 sched_ext/for-7.4] " Andrea Righi
2026-09-15 9:00 ` [PATCH 1/2] " Andrea Righi
2026-09-14 14:44 [PATCHSET v3 sched_ext/for-7.4] " Andrea Righi
2026-09-14 14:44 ` [PATCH 1/2] " Andrea Righi
2026-09-14 14:58 ` sashiko-bot
2026-09-11 19:56 [PATCHSET sched_ext/for-7.4] " Andrea Righi
2026-09-11 19:56 ` [PATCH 1/2] " Andrea Righi
2026-09-13 16:50 ` Tejun Heo
2026-09-14 6:05 ` 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=20260914090640.A47A81F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=arighi@nvidia.com \
--cc=sashiko-reviews@lists.linux.dev \
--cc=sched-ext@lists.linux.dev \
/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