From: David Vernet <void@manifault.com>
To: Tejun Heo <tj@kernel.org>
Cc: linux-kernel@vger.kernel.org, kernel-team@meta.com
Subject: Re: [PATCH sched_ext/for-6.12] sched_ext: Make scx_rq_online() also test cpu_active() in addition to SCX_RQ_ONLINE
Date: Thu, 8 Aug 2024 12:39:38 -0500 [thread overview]
Message-ID: <20240808173938.GD6223@maniforge> (raw)
In-Reply-To: <ZrPxkt57GdP6ILlA@slm.duckdns.org>
[-- Attachment #1: Type: text/plain, Size: 1057 bytes --]
On Wed, Aug 07, 2024 at 12:13:38PM -1000, Tejun Heo wrote:
> scx_rq_online() currently only tests SCX_RQ_ONLINE. This isn't fully correct
> - e.g. consume_dispatch_q() uses task_run_on_remote_rq() which tests
> scx_rq_online() to see whether the current rq can run the task, and, if so,
> calls consume_remote_task() to migrate the task to @rq. While the test
> itself was done while locking @rq, @rq can be temporarily unlocked by
> consume_remote_task() and nothing prevents SCX_RQ_ONLINE from going offline
> before the migration takes place.
>
> To address the issue, add cpu_active() test to scx_rq_online(). There is a
> synchronize_rcu() between cpu_active() being cleared and the rq going
> offline, so if an on-going scheduling operation sees cpu_active(), the
> associated rq is guaranteed to not go offline until the scheduling operation
> is complete.
>
> Signed-off-by: Tejun Heo <tj@kernel.org>
> Fixes: 60c27fb59f6c ("sched_ext: Implement sched_ext_ops.cpu_online/offline()")
Acked-by: David Vernet <void@manifault.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2024-08-08 17:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-07 22:13 Tejun Heo
2024-08-08 17:39 ` David Vernet [this message]
2024-08-08 23:38 ` 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=20240808173938.GD6223@maniforge \
--to=void@manifault.com \
--cc=kernel-team@meta.com \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®