mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Tao Cui <cui.tao@linux.dev>, Peter Zijlstra <peterz@infradead.org>
Cc: void@manifault.com, arighi@nvidia.com, changwoo@igalia.com,
	mingo@redhat.com, sched-ext@lists.linux.dev,
	linux-kernel@vger.kernel.org, bpf@vger.kernel.org,
	Tao Cui <cuitao@kylinos.cn>
Subject: Re: [PATCH 1/2] sched/core: Pass ENQUEUE_RQ_SELECTED on initial enqueue
Date: Sun, 15 Nov 2026 05:06:35 -1000	[thread overview]
Message-ID: <598bee2c48b23aee00c404d1183b581a@kernel.org> (raw)
In-Reply-To: <20261112144935.583937-2-cui.tao@linux.dev>

On Thu, Nov 12, 2026 at 10:49:34PM +0800, Tao Cui wrote:
> select_task_rq() sets WF_RQ_SELECTED and ttwu_do_activate() maps it to
> ENQUEUE_RQ_SELECTED so enqueue_task_scx() knows whether ops.select_cpu()
> ran. wake_up_new_task() also calls select_task_rq() but activates the
> new task without the flag, so on the fork path ops.enqueue() never sees
> SCX_ENQ_CPU_SELECTED and SCX_EV_SELECT_CPU_FALLBACK never counts a
> fork-path fallback: a misbehaving select_cpu() leaves no trace in the
> counters, and schedulers testing SCX_ENQ_CPU_SELECTED run a redundant
> select_cpu_dfl() on tasks select_cpu() already placed.
>
> Set ENQUEUE_RQ_SELECTED on the initial enqueue when select_task_rq() was
> called, matching the wakeup path. Only sched_ext consumes the flag.
>
> Fixes: 9b671793c7d9 ("sched_ext, scx_qmap: Add and use SCX_ENQ_CPU_SELECTED")
> Signed-off-by: Tao Cui <cuitao@kylinos.cn>

Acked-by: Tejun Heo <tj@kernel.org>

Peter, how do you want to route this? I can take it through sched_ext too
given that the flag is only consumed by sched_ext.

Thanks.

--
tejun

  reply	other threads:[~2026-11-15 15:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-12 14:49 [PATCH 0/2] sched_ext: Fix entry-path contract breaks in core.c Tao Cui
2026-11-12 14:49 ` [PATCH 1/2] sched/core: Pass ENQUEUE_RQ_SELECTED on initial enqueue Tao Cui
2026-11-15 15:06   ` Tejun Heo [this message]
2026-11-12 14:49 ` [PATCH 2/2] sched_ext: Block a retained donor before PI deboost routes it back to sched_ext Tao Cui
2026-11-12 15:21   ` Peter Zijlstra
2026-11-12 16:01     ` Peter Zijlstra
2026-11-12 16:32       ` Andrea Righi
2026-11-12 16:41         ` Peter Zijlstra
2026-11-12 16:50           ` Andrea Righi
2026-11-12 16:05     ` Andrea Righi
2026-11-12 16:31       ` Peter Zijlstra
2026-11-13  3:05   ` bot+bpf-ci

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=598bee2c48b23aee00c404d1183b581a@kernel.org \
    --to=tj@kernel.org \
    --cc=arighi@nvidia.com \
    --cc=bpf@vger.kernel.org \
    --cc=changwoo@igalia.com \
    --cc=cui.tao@linux.dev \
    --cc=cuitao@kylinos.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.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®