public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Cheng-Yang Chou <yphbchou0911@gmail.com>
To: zhidao su <soolaugust@gmail.com>
Cc: Tejun Heo <tj@kernel.org>, Andrea Righi <arighi@nvidia.com>,
	 David Vernet <void@manifault.com>,
	Changwoo Min <changwoo@igalia.com>,
	sched-ext@lists.linux.dev,  linux-kernel@vger.kernel.org,
	zhidao su <suzhidao@xiaomi.com>,
	 Ching-Chun Huang <jserv@ccns.ncku.edu.tw>,
	Chia-Ping Tsai <chia7712@gmail.com>
Subject: Re: [PATCH] sched_ext: Fix local_dsq_post_enq() to use task's scheduler in sub-sched
Date: Thu, 23 Apr 2026 12:27:34 +0800	[thread overview]
Message-ID: <20260423121149.Ge96e@cchengyang.duckdns.org> (raw)
In-Reply-To: <20260423025832.2654840-1-suzhidao@xiaomi.com>

Hi zhidao,

On Thu, Apr 23, 2026 at 10:58:32AM +0800, zhidao su wrote:
> local_dsq_post_enq() calls call_task_dequeue() with scx_root instead of
> the scheduler instance actually managing the task. When
> CONFIG_EXT_SUB_SCHED is enabled, tasks may be managed by a sub-scheduler
> whose ops.dequeue() callback differs from root's. Using scx_root causes
> the wrong scheduler's ops.dequeue() to be consulted: sub-sched tasks
> dispatched to a local DSQ via scx_bpf_dsq_move_to_local() will have
> SCX_TASK_IN_CUSTODY cleared but the sub-scheduler's ops.dequeue() is
> never invoked, violating the custody exit semantics.
> 
> Fix by adding a 'struct scx_sched *sch' parameter to local_dsq_post_enq()
> and move_local_task_to_local_dsq(), and propagating the correct scheduler
> from their callers dispatch_enqueue(), move_task_between_dsqs(), and
> consume_dispatch_q().
> 
> This is consistent with dispatch_enqueue()'s non-local path which already
> passes 'sch' directly to call_task_dequeue() for global/bypass DSQs.
> 
> Fixes: ebf1ccff79c4 ("sched_ext: Fix ops.dequeue() semantics")
> Signed-off-by: zhidao su <suzhidao@xiaomi.com>

This fix looks correct for the parameter mismatch.

Reviewed-by: Cheng-Yang Chou <yphbchou0911@gmail.com>

Regarding the Fixes tag: I'm not entirely sure if it's strictly required
since the sub-scheduler groundwork is still a new feature. However, since
it fixes a specific logic error, keeping the tag seems appropriate.

Thanks.

-- 
Cheers,
Cheng-Yang

  reply	other threads:[~2026-04-23  4:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-23  2:58 [PATCH] sched_ext: Fix local_dsq_post_enq() to use task's scheduler in sub-sched zhidao su
2026-04-23  4:27 ` Cheng-Yang Chou [this message]
2026-04-23 16:40 ` Tejun Heo

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=20260423121149.Ge96e@cchengyang.duckdns.org \
    --to=yphbchou0911@gmail.com \
    --cc=arighi@nvidia.com \
    --cc=changwoo@igalia.com \
    --cc=chia7712@gmail.com \
    --cc=jserv@ccns.ncku.edu.tw \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sched-ext@lists.linux.dev \
    --cc=soolaugust@gmail.com \
    --cc=suzhidao@xiaomi.com \
    --cc=tj@kernel.org \
    --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