[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <27c6a3f4-ca70-45ce-a684-fe8e9b33efd1@amd.com>
Date: Wed, 12 Nov 2025 11:37:00 +0530
From: K Prateek Nayak <kprateek.nayak@....com>
To: Wanpeng Li <kernellwp@...il.com>
CC: Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>, Paolo Bonzini <pbonzini@...hat.com>,
Sean Christopherson <seanjc@...gle.com>, Steven Rostedt
<rostedt@...dmis.org>, Vincent Guittot <vincent.guittot@...aro.org>, "Juri
Lelli" <juri.lelli@...hat.com>, <linux-kernel@...r.kernel.org>,
<kvm@...r.kernel.org>, Wanpeng Li <wanpengli@...cent.com>
Subject: Re: [PATCH 00/10] sched/kvm: Semantics-aware vCPU scheduling for
oversubscribed KVM
Hello Wanpeng,
On 11/12/2025 10:24 AM, Wanpeng Li wrote:
>>> Problem Statement
>>> -----------------
>>>
>>> In overcommitted virtualization scenarios, vCPUs frequently spin on locks
>>> held by other vCPUs that are not currently running. The kernel's
>>> paravirtual spinlock support detects these situations and calls yield_to()
>>> to boost the lock holder, allowing it to run and release the lock.
>>>
>>> However, the current implementation has two critical limitations:
>>>
>>> 1. Scheduler-side limitation:
>>>
>>> yield_to_task_fair() relies solely on set_next_buddy() to provide
>>> preference to the target vCPU. This buddy mechanism only offers
>>> immediate, transient preference. Once the buddy hint expires (typically
>>> after one scheduling decision), the yielding vCPU may preempt the target
>>> again, especially in nested cgroup hierarchies where vruntime domains
>>> differ.
>>
>> So what you are saying is there are configurations out there where vCPUs
>> of same guest are put in different cgroups? Why? Does the use case
>> warrant enabling the cpu controller for the subtree? Are you running
>
> You're right to question this. The problematic scenario occurs with
> nested cgroup hierarchies, which is common when VMs are deployed with
> cgroup-based resource management. Even when all vCPUs of a single
> guest are in the same leaf cgroup, that leaf sits under parent cgroups
> with their own vruntime domains.
>
> The issue manifests when:
> - set_next_buddy() provides preference at the leaf level
> - But vruntime competition happens at parent levels
If that is the case, then NEXT_BUDDY is in-eligible as a result of its
vruntime being higher that the weighted averages of other entity.
Won't this break fairness?
Let me go look at the series and come back.
> - The buddy hint gets "diluted" when pick_task_fair() walks up the hierarchy
>
--
Thanks and Regards,
Prateek
Powered by blists - more mailing lists