From: Yury Norov <ynorov@nvidia.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>, Thomas Gleixner <tglx@kernel.org>,
Juri Lelli <juri.lelli@redhat.com>,
Vincent Guittot <vincent.guittot@linaro.org>,
Shrikanth Hegde <sshegde@linux.ibm.com>,
Yury Norov <yury.norov@gmail.com>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Alexander Gordeev <agordeev@linux.ibm.com>,
Andrea Righi <arighi@nvidia.com>, Ben Segall <bsegall@google.com>,
Christian Borntraeger <borntraeger@linux.ibm.com>,
Danilo Krummrich <dakr@kernel.org>,
Dietmar Eggemann <dietmar.eggemann@arm.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Heiko Carstens <hca@linux.ibm.com>,
Johan Hovold <johan@kernel.org>, Jonathan Corbet <corbet@lwn.net>,
K Prateek Nayak <kprateek.nayak@amd.com>,
Mel Gorman <mgorman@suse.de>, Mete Durlu <meted@linux.ibm.com>,
Randy Dunlap <rdunlap@infradead.org>,
Rasmus Villemoes <linux@rasmusvillemoes.dk>,
Shuah Khan <skhan@linuxfoundation.org>,
Steven Rostedt <rostedt@goodmis.org>,
Sven Schnelle <svens@linux.ibm.com>,
Valentin Schneider <vschneid@redhat.com>,
Vasily Gorbik <gor@linux.ibm.com>,
linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org,
driver-core@lists.linux.dev, linux-s390@vger.kernel.org
Subject: Re: [PATCH 0/6] sched: Expose writable interface for preferred CPUs mask
Date: Fri, 6 Nov 2026 12:34:07 -0500 [thread overview]
Message-ID: <au4PfYJkpKLsISqb@yury> (raw)
In-Reply-To: <20261105145537.GP1813469@noisy.programming.kicks-ass.net>
On Thu, Nov 05, 2026 at 03:55:37PM +0100, Peter Zijlstra wrote:
> On Tue, Nov 03, 2026 at 11:49:02AM -0500, Yury Norov wrote:
> > On Mon, Nov 02, 2026 at 09:47:04AM +0100, Peter Zijlstra wrote:
> > > On Sun, Nov 01, 2026 at 02:21:56PM -0500, Yury Norov wrote:
> > > > The preferred CPU mask currently lets the steal governor reduce vCPU
> > > > demand when physical CPUs are contended. This series adds manual control,
> > > > opening more use cases.
> > >
> > > Sceptical, I am.
> > >
> > > > For example, setting CPUs aside for selected fair tasks at runtime while
> > > > steering other fair tasks toward the remaining CPUs.
> > >
> > > That's exactly the kind of nonsense we don't need and makes me want to
> > > stop reading right here.
> >
> > OK, I started with the wrong argument. Please consider this as the argument
> > #3.
> >
> > #1 is: conceptually, preferred cpumask improves performance because it
> > moves the scheduling decision from host to the guest level. The guest
> > can do it better because it knows more about the workload. But then we'd
> > consider moving steal governor logic to the guest userspace, because it
> > knows the nature of user workload even more.
>
> I am confused; it is a simple control loop and has nothing to do with
> guest workload.
>
> The host is over-committed, this results in vcpu steal time. The guests
> observe steal time and reduce vcpu utilization.
>
> It is a co-operative scheme; a bad actor can game the system. It is
> imperative all guests behave the same or do not play at all.
>
> If there is no level of trust (our coconut friends) do not use this.
That is correct. I'm just trying to let trusted userspace to be able to
make a final decision, not to cheat the policy.
I believe that the preferred cpumask approach may find more use cases
than just a blind vCPU throttling.
Even in case of throttling, the userspace might know more about the
nature of external pressure, workload and VM priorities, etc., so be
able to make a better decision on the preferred vCPU candidates,
beyond the steal time accounting.
I can imagine a host running two VMs - one for performance critical
workload like AI training, and another for latency critical inference.
In case of vCPU overcommitment, symmetrical throttling of both VMs
may substantially affect user experience. The better solution would be
allowing both VMs to communicate to each other and decide how many
vCPUs should become non-preferred on each side.
Steal governor is a reasonable default approach to the vCPU overcommit
problem. But I also want to be able to adjust it to my local needs, if
I have to.
> > #2: convenience and scope. Some systems don't allow loading modules -
> > either on config level, through selinux, or somehow else. They don't
> > even have compiler installed sometimes.
>
> You hurt if you shoot your foot off; not my problem. If you run guests
> like that you don't use this.
I don't configure systems that way - I only request shared access to the
particular hardware, i.e. to run some tests, often for just a few hours.
Sometimes those machines don't allow loading modules, sometimes it takes
few iterations to reach to admins and ask them to update drivers...
> > > we already have cpusets that is more than capable of doing this.
> >
> > Then why do we need the steal governor at all? We can steer all
> > processes away from a given vCPU without any driver, only by playing
> > with each individual process' affinity. For vCPU throttling, task
> > isolation, or whatever purpose.
>
> Different level of operation; different semantics. Cpusets is for strong
> bounds on your own workloads, this preferred mask is weak bounds on the
> system due to outside pressure.
>
> In a way it isn't much different from ACPI idle injection.
The idle-injection indeed has userspace interface. Powerclamp exposes
its actuator through /sys/class/thermal/cooling_deviceXX, and documents
userspace control loop.
By the way, preferred CPUs approach may prepend hotplug in the overheat
defense chain, as a cheap but weaker alternative.
Thanks,
Yury
prev parent reply other threads:[~2026-11-06 17:34 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-01 19:21 Yury Norov
2026-11-01 19:21 ` [PATCH 1/6] sched: decouple PREFERRED_CPU from PARAVIRT in Kconfig.preempt Yury Norov
2026-11-02 10:16 ` Ilya Leoshkevich
2026-11-02 11:00 ` Peter Zijlstra
2026-11-02 11:34 ` Ilya Leoshkevich
2026-11-02 13:00 ` Shrikanth Hegde
2026-11-02 13:41 ` Ilya Leoshkevich
2026-11-02 14:57 ` Shrikanth Hegde
2026-11-03 5:49 ` Shrikanth Hegde
2026-11-03 11:26 ` Ilya Leoshkevich
2026-11-03 11:30 ` Ilya Leoshkevich
2026-11-01 19:21 ` [PATCH 2/6] cpumask: Add reset_preferred_cpumask() helper Yury Norov
2026-11-01 19:21 ` [PATCH 3/6] sched: Restore preferred CPUs when hotplug removes the last one Yury Norov
2026-11-05 9:05 ` Fushuai Wang
2026-11-05 13:27 ` Yury Norov
2026-11-01 19:22 ` [PATCH 4/6] sched: serialize preferred cpumask update better Yury Norov
2026-11-01 19:22 ` [PATCH 5/6] virt: steal_governor: Warn on unexpected preferred mask states Yury Norov
2026-11-01 19:22 ` [PATCH 6/6] cpu: Add per-CPU preferred sysfs control Yury Norov
2026-11-02 8:47 ` [PATCH 0/6] sched: Expose writable interface for preferred CPUs mask Peter Zijlstra
2026-11-03 16:49 ` Yury Norov
2026-11-05 14:55 ` Peter Zijlstra
2026-11-06 17:34 ` Yury Norov [this message]
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=au4PfYJkpKLsISqb@yury \
--to=ynorov@nvidia.com \
--cc=agordeev@linux.ibm.com \
--cc=arighi@nvidia.com \
--cc=borntraeger@linux.ibm.com \
--cc=bsegall@google.com \
--cc=corbet@lwn.net \
--cc=dakr@kernel.org \
--cc=dietmar.eggemann@arm.com \
--cc=driver-core@lists.linux.dev \
--cc=gor@linux.ibm.com \
--cc=gregkh@linuxfoundation.org \
--cc=hca@linux.ibm.com \
--cc=johan@kernel.org \
--cc=juri.lelli@redhat.com \
--cc=kprateek.nayak@amd.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=meted@linux.ibm.com \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rafael@kernel.org \
--cc=rdunlap@infradead.org \
--cc=rostedt@goodmis.org \
--cc=skhan@linuxfoundation.org \
--cc=sshegde@linux.ibm.com \
--cc=svens@linux.ibm.com \
--cc=tglx@kernel.org \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.com \
--cc=yury.norov@gmail.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®