All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Andrea Righi" <arighi@nvidia.com>
Cc: sched-ext@lists.linux.dev
Subject: Re: [PATCH 10/10] sched: Allow enabling proxy exec with sched_ext
Date: Mon, 13 Jul 2026 16:49:47 +0000	[thread overview]
Message-ID: <20260713164948.4C02E1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260713162112.26785-11-arighi@nvidia.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Normal task wakeups are misidentified as blocked proxy donors in sched_ext operations (`scx_do_enqueue_task` and `wakeup_preempt_scx`), causing incorrect `SCX_ENQ_BLOCKED` flags and unconditional reschedules.
--

--- Patch [10]: [PATCH 10/10] sched: Allow enabling proxy exec with sched_ext ---
commit 3a82f8102afed9269cf69799a73d94ed44769f33
Author: Andrea Righi <arighi@nvidia.com>

sched: Allow enabling proxy exec with sched_ext
    
Now that sched_ext can handle proxy donors and BPF schedulers can opt in
to blocked-donor enqueueing with SCX_OPS_ENQ_BLOCKED, remove the
!SCHED_CLASS_EXT dependency from SCHED_PROXY_EXEC and allow both options
to be enabled together.

> diff --git a/init/Kconfig b/init/Kconfig
> index 9ee6447dd454d..52376c44f60a6 100644
> --- a/init/Kconfig
> +++ b/init/Kconfig
> @@ -937,8 +937,6 @@ config SCHED_PROXY_EXEC
>  	bool "Proxy Execution"
>  	# Avoid some build failures w/ PREEMPT_RT until it can be fixed
>  	depends on !PREEMPT_RT
> -	# Need to investigate how to inform sched_ext of split contexts
> -	depends on !SCHED_CLASS_EXT

[Severity: High]
Does enabling proxy exec with sched_ext here expose an issue where normal
task wakeups are misidentified as blocked proxy donors?

When tasks go to sleep without pending signals, try_to_block_task() sets
p->is_blocked = 1. When these tasks wake up, ttwu_do_activate() processes
them in this order:

kernel/sched/core.c:ttwu_do_activate() {
        ...
        activate_task(rq, p, en_flags);
        wakeup_preempt(rq, p, wake_flags);
        
        ttwu_do_wakeup(p);
        ...
}

Because activate_task() and wakeup_preempt() are called before
ttwu_do_wakeup() clears the p->is_blocked flag, p->is_blocked remains 1
during the sched_ext callbacks:

kernel/sched/ext/ext.c:scx_do_enqueue_task() {
        ...
        enq_blocked = (sch->ops.flags & SCX_OPS_ENQ_BLOCKED) &&
                      p->is_blocked;
        if (enq_blocked)
                enq_flags |= SCX_ENQ_BLOCKED;
        ...
}

And also in the wakeup path:

kernel/sched/ext/ext.c:wakeup_preempt_scx() {
        ...
        if (p->is_blocked) {
                struct scx_sched *sch = scx_task_sched(p);
                
                if (sch && (sch->ops.flags & SCX_OPS_ENQ_BLOCKED))
                        resched_curr(rq);
        }
        return;
}

If a BPF scheduler opts into SCX_OPS_ENQ_BLOCKED, will this force an
unconditional reschedule on every wakeup and skip intended preemption logic,
since it incorrectly sees all normal waking tasks as SCX_ENQ_BLOCKED?

Would it be safer for sched_ext to use task_is_blocked(p) (which evaluates
!!p->blocked_on) rather than p->is_blocked to correctly identify actual
blocked proxy donors?

>  	# Not particularly useful until we get to multi-rq proxying
>  	depends on EXPERT
>  	help

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260713162112.26785-1-arighi@nvidia.com?part=10

  reply	other threads:[~2026-07-13 16:49 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-13 16:17 [PATCHSET v5 sched_ext/for-7.3] sched: Make proxy execution compatible with sched_ext Andrea Righi
2026-07-13 16:17 ` [PATCH 01/10] sched: Add helper to block retained proxy donors Andrea Righi
2026-07-13 16:17 ` [PATCH 02/10] sched_ext: Block proxy donors across scheduler transitions Andrea Righi
2026-07-13 16:41   ` sashiko-bot
2026-07-13 16:17 ` [PATCH 03/10] sched_ext: Fix ops.running/stopping() pairing for proxy-exec donors Andrea Righi
2026-07-13 16:17 ` [PATCH 04/10] sched_ext: Split curr|donor references properly Andrea Righi
2026-07-13 16:48   ` sashiko-bot
2026-07-13 16:17 ` [PATCH 05/10] sched_ext: Fix TOCTOU race in consume_remote_task() Andrea Righi
2026-07-13 16:17 ` [PATCH 06/10] sched_ext: Handle blocked donor migration with proxy execution Andrea Righi
2026-07-13 16:44   ` sashiko-bot
2026-07-13 16:17 ` [PATCH 07/10] sched_ext: Delegate proxy donor admission to BPF schedulers Andrea Righi
2026-07-13 16:45   ` sashiko-bot
2026-07-13 16:17 ` [PATCH 08/10] sched_ext: Add selftest for blocked donor admission Andrea Righi
2026-07-13 16:34   ` sashiko-bot
2026-07-13 16:17 ` [PATCH 09/10] sched_ext: scx_qmap: Add proxy execution support Andrea Righi
2026-07-13 16:17 ` [PATCH 10/10] sched: Allow enabling proxy exec with sched_ext Andrea Righi
2026-07-13 16:49   ` sashiko-bot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-07-10  8:36 [PATCHSET v4 sched_ext/for-7.3] sched: Make proxy execution compatible " Andrea Righi
2026-07-10  8:36 ` [PATCH 10/10] sched: Allow enabling proxy exec " Andrea Righi
2026-05-06 17:45 [RFC PATCH sched_ext/for-7.2 0/10] sched: Make proxy execution compatible " Andrea Righi
2026-05-06 17:45 ` [PATCH 10/10] sched: Allow enabling proxy exec " 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=20260713164948.4C02E1F000E9@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 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.