From: sashiko-bot@kernel.org
To: "Vincent Guittot" <vincent.guittot@linaro.org>,
sched-ext@lists.linux.dev
Subject: Re: [PATCH 15/20 v3] sched/fair: Enable push task for preempt short
Date: Fri, 06 Nov 2026 16:27:45 +0000 [thread overview]
Message-ID: <sashiko-outbox-201811@kernel.org> (raw)
In-Reply-To: <20261106151947.3991524-16-vincent.guittot@linaro.org>
Thank you for your contribution! Sashiko AI review found 4 potential
issues to consider:
- [High] sched/fair: enabling sched_push_task pushes throttled or active
proxy tasks
- [Medium] sched/topology: sched_push_task not enabled at boot in
sched_init_domains()
- [Medium] sched/topology: sched_push_task never disabled when
PREEMPT_SHORT is off
- [Medium] sched/fair: missing rq_lock() and clock flag handling in
fair_push_task()
--
commit eb9f484eef47f92f3c12dabb60d19453a2d64efa
Author: Vincent Guittot <vincent.guittot@linaro.org>
sched/fair: Enable push task for preempt short
This commit enables the sched_push_task static branch in
partition_sched_domains_locked() when the PREEMPT_SHORT scheduler feature
is set.
> diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
> index 919d0fb00bd9f..5481f2472e175 100644
> --- a/kernel/sched/topology.c
> +++ b/kernel/sched/topology.c
> @@ -3497,6 +3497,9 @@ static void partition_sched_domains_locked(int ndoms_new, cpumask_var_t doms_new
> sched_energy_set(has_eas);
> #endif
>
> + if (sched_feat(PREEMPT_SHORT) && !static_branch_likely(&sched_push_task))
> + static_branch_enable_cpuslocked(&sched_push_task);
[Severity: High]
Can enabling sched_push_task cause throttled or proxy-executing tasks to be
queued onto rq->cfs.pushable_tasks and pushed to another CPU?
In put_prev_task_fair(), fair_add_pushable_prev() is called even when
se->on_rq is 0, and __check_pushable_fair_task() only checks
task_on_rq_queued(p) without checking p->se.on_rq, !task_is_throttled(p),
!task_is_blocked(p), or !task_on_cpu(rq, p):
kernel/sched/fair.c:put_prev_task_fair() {
...
if (se->on_rq)
__enqueue_entity(cfs_rq, se);
if (next) {
if (next != prev)
fair_add_pushable_prev(rq, prev, next);
...
}
Under CONFIG_CFS_BANDWIDTH, throttle_cfs_rq_work() dequeues a task with
DEQUEUE_SLEEP | DEQUEUE_THROTTLE, clearing p->se.on_rq and setting
p->throttled while leaving p->on_rq == TASK_ON_RQ_QUEUED. When that task
schedules out, put_prev_task_fair() can add it to rq->cfs.pushable_tasks.
If fair_push_task() then migrates it to an unthrottled cfs_rq,
activate_task() -> enqueue_task_fair() -> enqueue_throttled_task() clears
p->throttled and bypasses the CFS bandwidth quota; if the throttled task is
instead dequeued by sched_move_task() or do_set_cpus_allowed(),
dequeue_task_fair() returns early via dequeue_throttled_task() without
calling fair_remove_pushable_task(), leaving p->pushable_tasks corruptly
linked on rq->cfs.pushable_tasks.
Similarly, under CONFIG_SCHED_PROXY_EXEC, proxy_needs_return() calls
dequeue_block_task(rq, p, TASK_WAKING) before proxy_reset_donor() calls
put_prev_set_next_task(), which can link the waking task onto
rq->cfs.pushable_tasks before try_to_wake_up() migrates it to another CPU,
and switching rq->donor away from a mutex owner that remains rq->curr
allows fair_push_task() to deactivate and migrate a task that is actively
executing on the CPU.
[Severity: Medium]
Does fair_push_task() miss RQCF_UPDATED clearing and rq_lock()/rq_unlock()
pinning when migrating a task?
kernel/sched/fair.c:fair_push_task() {
...
deactivate_task(rq, next_task, 0);
set_task_cpu(next_task, new_cpu);
raw_spin_rq_unlock(rq);
raw_spin_rq_lock(new_rq);
WARN_ON_ONCE(task_cpu(next_task) != new_cpu);
activate_task(new_rq, next_task, 0);
wakeup_preempt(new_rq, next_task, 0);
raw_spin_rq_unlock(new_rq);
/* Restore rq lock state */
raw_spin_rq_lock(rq);
}
When __balance_callbacks() runs fair_push_task() at the end of
__schedule(), rq_unpin_lock(rq, &rf) has already unpinned rq->__lock and
invalidated the sched_ext clock, but RQCF_UPDATED remains set on
rq->clock_update_flags. Calling deactivate_task(rq, next_task, 0) without
DEQUEUE_NOCLOCK (or clearing RQCF_UPDATED) calls update_rq_clock(rq) again,
triggering WARN_DOUBLE_CLOCK and re-setting SCX_RQ_CLK_VALID on
rq->scx.flags after rq_unpin_lock(). In addition, locking new_rq with
raw_spin_rq_lock() and raw_spin_rq_unlock() instead of rq_lock() and
rq_unlock() skips rq_pin_lock() and rq_unpin_lock() on new_rq, triggering
WARN_DOUBLE_CLOCK in activate_task() and leaving SCX_RQ_CLK_VALID set on
new_rq after unlock.
[Severity: Medium]
Does sched_push_task remain disabled after boot on systems that only build
domains through sched_init_domains()?
During boot, smp_init() brings secondary CPUs online before
sched_smp_initialized is set, and sched_init_smp() then initializes domains
via sched_init_domains() -> build_sched_domains() without calling
partition_sched_domains_locked(). On systems that do not later rebuild
scheduler domains (for example via Energy Model registration, ITMT, CPU
hotplug, or cpuset updates), sched_push_task is never enabled even though
PREEMPT_SHORT is on by default.
[Severity: Medium]
What disables sched_push_task (or stops check_pushable_short_task()) when
PREEMPT_SHORT is disabled at runtime via /sys/kernel/debug/sched/features?
partition_sched_domains_locked() only enables sched_push_task and has no
corresponding disable path when !sched_feat(PREEMPT_SHORT), and
check_pushable_short_task() does not test sched_feat(PREEMPT_SHORT). Also,
note that fair_remove_pushable_task() gates plist_del() on
sched_push_task_enabled(), so disabling the static branch while tasks are
queued on rq->cfs.pushable_tasks would skip unlinking them on dequeue.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261106151947.3991524-2-vincent.guittot@linaro.org?part=15
next prev parent reply other threads:[~2026-11-06 16:27 UTC|newest]
Thread overview: 67+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-06 15:19 [PATCH 00/18 v3] Improving latency of short slice tasks Vincent Guittot
2026-11-06 15:19 ` [PATCH 01/20 v3] sched/eevdf: Decay positive lag of sleeping entities Vincent Guittot
2026-11-06 15:43 ` sashiko-bot
2026-11-06 15:19 ` [PATCH 02/20 v3] sched/eevdf: Reset lag at wakeup when prev CPU has been idle Vincent Guittot
2026-11-06 16:22 ` Kayra Cizmeci
2026-11-09 15:27 ` Vincent Guittot
2026-11-09 15:45 ` Peter Zijlstra
2026-11-09 16:27 ` Vincent Guittot
2026-11-11 9:03 ` Peter Zijlstra
2026-11-12 7:02 ` Vincent Guittot
2026-11-11 10:04 ` K Prateek Nayak
2026-11-12 7:33 ` Vincent Guittot
2026-11-06 15:19 ` [PATCH 03/20 v3] sched/eevdf: Reset lag at wakeup when migrating and prev " Vincent Guittot
2026-11-06 18:05 ` Kayra Cizmeci
2026-11-06 15:19 ` [PATCH 04/20 v3] sched/eevdf: Reset lag when waking up on idle cpu Vincent Guittot
2026-11-06 18:39 ` Kayra Cizmeci
2026-11-06 15:19 ` [PATCH 05/20 v3] sched/eevdf: Add per cpu cached min_slice Vincent Guittot
2026-11-07 6:53 ` Kayra Cizmeci
2026-11-09 15:27 ` Vincent Guittot
2026-11-06 15:19 ` [PATCH 06/20 v3] sched/eevdf: Add min slice check when selecting CPU Vincent Guittot
2026-11-06 15:40 ` sashiko-bot
2026-11-07 8:57 ` Kayra Cizmeci
2026-11-09 13:55 ` Peter Zijlstra
2026-11-09 14:15 ` Kayra Cizmeci
2026-11-09 15:37 ` Vincent Guittot
2026-11-09 15:34 ` Vincent Guittot
2026-11-09 15:55 ` Vincent Guittot
2026-11-09 19:56 ` Kayra Cizmeci
2026-11-10 13:32 ` Vincent Guittot
2026-11-06 15:19 ` [PATCH 07/20 v3] sched/fair: Prepare select_task_rq_fair() to be called for new cases Vincent Guittot
2026-11-06 15:39 ` sashiko-bot
2026-11-06 15:19 ` [PATCH 08/20 v3] sched/fair: Add push task mechanism for fair Vincent Guittot
2026-11-06 16:15 ` sashiko-bot
2026-11-09 14:43 ` Peter Zijlstra
2026-11-09 16:07 ` Vincent Guittot
2026-11-11 8:59 ` Peter Zijlstra
2026-11-12 7:01 ` Vincent Guittot
2026-11-09 15:54 ` Peter Zijlstra
2026-11-09 16:14 ` Vincent Guittot
2026-11-11 9:01 ` Peter Zijlstra
2026-11-12 7:01 ` Vincent Guittot
2026-11-12 7:36 ` Vincent Guittot
2026-11-12 9:49 ` Peter Zijlstra
2026-11-12 11:29 ` Vincent Guittot
2026-11-12 12:19 ` Peter Zijlstra
2026-11-06 15:19 ` [PATCH 09/20 v3] sched/fair: Optimize " Vincent Guittot
2026-11-06 16:00 ` sashiko-bot
2026-11-06 15:19 ` [PATCH 10/20 v3] sched/core: Add rq flag to tick parameters Vincent Guittot
2026-11-06 15:19 ` [PATCH 11/20 v3] sched/fair: Add force push task mechanism for fair Vincent Guittot
2026-11-06 16:16 ` sashiko-bot
2026-11-06 15:19 ` [PATCH 12/20 v3] sched/fair: Support not wakeup case in select_idle_sibling Vincent Guittot
2026-11-06 15:51 ` sashiko-bot
2026-11-06 15:19 ` [PATCH 13/20] sched/eevdf: Try to push short slice task on a better CPU Vincent Guittot
2026-11-06 16:12 ` sashiko-bot
2026-11-06 15:19 ` [PATCH 14/20 v3] sched/eevdf: Push short slice task that are not picked Vincent Guittot
2026-11-06 16:14 ` sashiko-bot
2026-11-06 15:19 ` [PATCH 15/20 v3] sched/fair: Enable push task for preempt short Vincent Guittot
2026-11-06 16:27 ` sashiko-bot [this message]
2026-11-06 15:19 ` [PATCH 16/20 v3] energy model: Add a get previous state function Vincent Guittot
2026-11-10 19:55 ` Rafael J. Wysocki (Intel)
2026-11-06 15:19 ` [PATCH 17/20 v3] sched/fair: Rework feec() to use cost instead of spare capacity Vincent Guittot
2026-11-06 16:30 ` sashiko-bot
2026-11-06 15:19 ` [PATCH 18/20 v3] energy model: Remove unused em_cpu_energy() Vincent Guittot
2026-11-06 15:19 ` [PATCH 19/20 v3] sched/fair: Take into account slice in EAS Vincent Guittot
2026-11-06 16:26 ` sashiko-bot
2026-11-06 15:19 ` [PATCH 20/20 v3] sched/fair: Fix tasks stacking on same idle CPU Vincent Guittot
2026-11-06 16:53 ` sashiko-bot
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=sashiko-outbox-201811@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=sched-ext@lists.linux.dev \
--cc=vincent.guittot@linaro.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.