From: sashiko-bot@kernel.org
To: "Yury Norov" <ynorov@nvidia.com>
Cc: linux-s390@vger.kernel.org, "Heiko Carstens" <hca@linux.ibm.com>,
"Vasily Gorbik" <gor@linux.ibm.com>,
"Alexander Gordeev" <agordeev@linux.ibm.com>,
"Christian Borntraeger" <borntraeger@linux.ibm.com>
Subject: Re: [PATCH 4/7] virt: steal_governor: serialize sampling against CPU hotplug
Date: Fri, 13 Nov 2026 19:03:29 +0000 [thread overview]
Message-ID: <sashiko-outbox-213495@kernel.org> (raw)
In-Reply-To: <20261113184257.621707-5-ynorov@nvidia.com>
> Steal governor is not safe against a concurrent CPU hotplug operation
> because it can change active and preferred cpumasks during the governor
> sampling.
>
> To address the race, the governor would take the cpus_write_lock(). But
> that may be impractical for the loadable module.
>
> Instead, implement the following locking policy:
>
> - if the code takes cpus_write_lock(), it's enough to write-access
> the preferred cpumask;
> - if the code takes cpus_read_lock(), it must also take
> cpu_preferred_mutex in order to modify the preferred mask.
>
> The core scheduler and hotplug paths already modify the preferred cpumask
> under the cpus_write_lock(), so no change in core logic is required.
>
> This provides a common update protocol for multiple policy drivers
> without requiring writers to take the broader CPU hotplug write lock.
>
> Fixes: 27d47ebce4d6 ("virt/steal_governor: Implement steal_governor policy loop")
> Signed-off-by: Yury Norov <ynorov@nvidia.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261113184257.621707-2-ynorov@nvidia.com?part=4
next prev parent reply other threads:[~2026-11-13 19:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20261113184257.621707-1-ynorov@nvidia.com>
[not found] ` <20261113184257.621707-2-ynorov@nvidia.com>
2026-11-13 18:55 ` [PATCH 1/7] cpumask: add reset_preferred_cpumask() helper sashiko-bot
[not found] ` <20261113184257.621707-4-ynorov@nvidia.com>
2026-11-13 18:56 ` [PATCH 3/7] virt: steal_governor: remove the minimum elapsed-time check sashiko-bot
[not found] ` <20261113184257.621707-5-ynorov@nvidia.com>
2026-11-13 19:03 ` sashiko-bot [this message]
[not found] ` <20261113184257.621707-6-ynorov@nvidia.com>
2026-11-13 19:06 ` [PATCH 5/7] virt: steal_governor: warn on unexpected preferred mask states sashiko-bot
[not found] ` <20261113184257.621707-3-ynorov@nvidia.com>
2026-11-13 19:12 ` [PATCH 2/7] sched: restore preferred CPUs when hotplug removes the last one sashiko-bot
[not found] ` <20261113184257.621707-7-ynorov@nvidia.com>
2026-11-13 19:21 ` [PATCH 6/7] virt: steal_governor: restart sampling immediately after CPU hotplug sashiko-bot
[not found] ` <20261113184257.621707-8-ynorov@nvidia.com>
2026-11-13 19:25 ` [PATCH 7/7] cpu: make preferred CPU policy writers mutually exclusive sashiko-bot
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=sashiko-outbox-213495@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=agordeev@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=linux-s390@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=ynorov@nvidia.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