From: David Vernet <void@manifault.com>
To: Tejun Heo <tj@kernel.org>
Cc: linux-kernel@vger.kernel.org,
Peter Zijlstra <peterz@infradead.org>,
kernel-team@meta.com
Subject: Re: [PATCH 1/2 sched_ext/for-6.12] sched_ext: Use task_can_run_on_remote_rq() test in dispatch_to_local_dsq()
Date: Fri, 30 Aug 2024 12:22:07 -0500 [thread overview]
Message-ID: <20240830172207.GC5055@maniforge> (raw)
In-Reply-To: <ZtGkPKgoE5BeI7fN@slm.duckdns.org>
[-- Attachment #1: Type: text/plain, Size: 1442 bytes --]
On Fri, Aug 30, 2024 at 12:51:40AM -1000, Tejun Heo wrote:
> When deciding whether a task can be migrated to a CPU,
> dispatch_to_local_dsq() was open-coding p->cpus_allowed and scx_rq_online()
> tests instead of using task_can_run_on_remote_rq(). This had two problems.
>
> - It was missing is_migration_disabled() check and thus could try to migrate
> a task which shouldn't leading to assertion and scheduling failures.
>
> - It was testing p->cpus_ptr directly instead of using task_allowed_on_cpu()
> and thus failed to consider ISA compatibility.
>
> Update dispatch_to_local_dsq() to use task_can_run_on_remote_rq():
>
> - Move scx_ops_error() triggering into task_can_run_on_remote_rq().
>
> - When migration isn't allowed, fall back to the global DSQ instead of the
> source DSQ by returning DTL_INVALID. This is both simpler and an overall
> better behavior.
Should we also be falling back to the global DSQ if we fail the check
when called from process_ddsp_deferred_locals()? This patch doesn't
change anything given that we'd have the same behavior before if we
failed the cpumask_test_cpu(cpu_of(dst_rq), p->cpus_ptr) check, but I'm
not following why we would need to fall back to global DSQ in
finish_dispatch(), but not in process_ddsp_deferred_locals().
This doesn't affect the rest of the cleanup + fix, which LGTM:
Acked-by: David Vernet <void@manifault.com>
Thanks,
David
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2024-08-30 17:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-30 10:51 [PATCH 1/2 sched_ext/for-6.12] sched_ext: Use task_can_run_on_remote_rq() test in dispatch_to_local_dsq() Tejun Heo
2024-08-30 10:52 ` [PATCH 2/2 sched_ext/for-6.12] sched_ext: Use ktime_get_ns() instead of rq_clock_task() in touch_core_sched() Tejun Heo
2024-08-30 17:40 ` David Vernet
2024-08-30 17:45 ` Tejun Heo
2024-09-02 9:59 ` Peter Zijlstra
2024-08-30 17:54 ` [PATCH v2 2/2 sched_ext/for-6.12] sched_ext: Use sched_clock_cpu() " Tejun Heo
2024-08-30 18:01 ` David Vernet
2024-08-31 5:36 ` Tejun Heo
2024-08-30 17:22 ` David Vernet [this message]
2024-08-30 17:35 ` [PATCH 1/2 sched_ext/for-6.12] sched_ext: Use task_can_run_on_remote_rq() test in dispatch_to_local_dsq() 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=20240830172207.GC5055@maniforge \
--to=void@manifault.com \
--cc=kernel-team@meta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=tj@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox