From: Sean Christopherson <seanjc@google.com>
To: "Vineeth Pillai (Google)" <vineeth@bitbyteword.org>
Cc: Ben Segall <bsegall@google.com>, Borislav Petkov <bp@alien8.de>,
Daniel Bristot de Oliveira <bristot@redhat.com>,
Dave Hansen <dave.hansen@linux.intel.com>,
Dietmar Eggemann <dietmar.eggemann@arm.com>,
"H . Peter Anvin" <hpa@zytor.com>, Ingo Molnar <mingo@redhat.com>,
Juri Lelli <juri.lelli@redhat.com>, Mel Gorman <mgorman@suse.de>,
Paolo Bonzini <pbonzini@redhat.com>,
Andy Lutomirski <luto@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Thomas Gleixner <tglx@linutronix.de>,
Valentin Schneider <vschneid@redhat.com>,
Vincent Guittot <vincent.guittot@linaro.org>,
Vitaly Kuznetsov <vkuznets@redhat.com>,
Wanpeng Li <wanpengli@tencent.com>,
Steven Rostedt <rostedt@goodmis.org>,
Joel Fernandes <joel@joelfernandes.org>,
Suleiman Souhlal <suleiman@google.com>,
Masami Hiramatsu <mhiramat@kernel.org>,
himadrics@inria.fr, kvm@vger.kernel.org,
linux-kernel@vger.kernel.org, x86@kernel.org
Subject: Re: [RFC PATCH v2 0/5] Paravirt Scheduling (Dynamic vcpu priority management)
Date: Wed, 1 May 2024 15:29:31 +0000 [thread overview]
Message-ID: <ZjJf27yn-vkdB32X@google.com> (raw)
In-Reply-To: <20240403140116.3002809-1-vineeth@bitbyteword.org>
On Wed, Apr 03, 2024, Vineeth Pillai (Google) wrote:
> Double scheduling is a concern with virtualization hosts where the host
> schedules vcpus without knowing whats run by the vcpu and guest schedules
> tasks without knowing where the vcpu is physically running. This causes
> issues related to latencies, power consumption, resource utilization
> etc. An ideal solution would be to have a cooperative scheduling
> framework where the guest and host shares scheduling related information
> and makes an educated scheduling decision to optimally handle the
> workloads. As a first step, we are taking a stab at reducing latencies
> for latency sensitive workloads in the guest.
>
> v1 RFC[1] was posted in December 2023. The main disagreement was in the
> implementation where the patch was making scheduling policy decisions
> in kvm and kvm is not the right place to do it. The suggestion was to
> move the polcy decisions outside of kvm and let kvm only handle the
> notifications needed to make the policy decisions. This patch series is
> an iterative step towards implementing the feature as a layered
> design where the policy could be implemented outside of kvm as a
> kernel built-in, a kernel module or a bpf program.
>
> This design comprises mainly of 4 components:
>
> - pvsched driver: Implements the scheduling policies. Register with
> host with a set of callbacks that hypervisor(kvm) can use to notify
> vcpu events that the driver is interested in. The callback will be
> passed in the address of shared memory so that the driver can get
> scheduling information shared by the guest and also update the
> scheduling policies set by the driver.
> - kvm component: Selects the pvsched driver for a guest and notifies
> the driver via callbacks for events that the driver is interested
> in. Also interface with the guest in retreiving the shared memory
> region for sharing the scheduling information.
> - host kernel component: Implements the APIs for:
> - pvsched driver for register/unregister to the host kernel, and
> - hypervisor for assingning/unassigning driver for guests.
> - guest component: Implements a framework for sharing the scheduling
> information with the pvsched driver through kvm.
Roughly summarazing an off-list discussion.
- Discovery schedulers should be handled outside of KVM and the kernel, e.g.
similar to how userspace uses PCI, VMBUS, etc. to enumerate devices to the guest.
- "Negotiating" features/hooks should also be handled outside of the kernel,
e.g. similar to how VirtIO devices negotiate features between host and guest.
- Pushing PV scheduler entities to KVM should either be done through an exported
API, e.g. if the scheduler is provided by a separate kernel module, or by a
KVM or VM ioctl() (especially if the desire is to have per-VM schedulers).
I think those were the main takeaways? Vineeth and Joel, please chime in on
anything I've missed or misremembered.
The other reason I'm bringing this discussion back on-list is that I (very) briefly
discussed this with Paolo, and he pointed out the proposed rseq-based mechanism
that would allow userspace to request an extended time slice[*], and that if that
landed it would be easy-ish to reuse the interface for KVM's steal_time PV API.
I see that you're both on that thread, so presumably you're already aware of the
idea, but I wanted to bring it up here to make sure that we aren't trying to
design something that's more complex than is needed.
Specifically, if the guest has a generic way to request an extended time slice
(or boost its priority?), would that address your use cases? Or rather, how close
does it get you? E.g. the guest will have no way of requesting a larger time
slice or boosting priority when an event is _pending_ but not yet receiveed by
the guest, but is that actually problematic in practice?
[*] https://lore.kernel.org/all/20231025235413.597287e1@gandalf.local.home
next prev parent reply other threads:[~2024-05-01 15:29 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-03 14:01 [RFC PATCH v2 0/5] Paravirt Scheduling (Dynamic vcpu priority management) Vineeth Pillai (Google)
2024-04-03 14:01 ` [RFC PATCH v2 1/5] pvsched: paravirt scheduling framework Vineeth Pillai (Google)
2024-04-08 13:57 ` Vineeth Remanan Pillai
2024-04-03 14:01 ` [RFC PATCH v2 2/5] kvm: Implement the paravirt sched framework for kvm Vineeth Pillai (Google)
2024-04-08 13:58 ` Vineeth Remanan Pillai
2024-04-03 14:01 ` [RFC PATCH v2 3/5] kvm: interface for managing pvsched driver for guest VMs Vineeth Pillai (Google)
2024-04-08 13:59 ` Vineeth Remanan Pillai
2024-04-03 14:01 ` [RFC PATCH v2 4/5] pvsched: bpf support for pvsched Vineeth Pillai (Google)
2024-04-08 14:00 ` Vineeth Remanan Pillai
2024-04-03 14:01 ` [RFC PATCH v2 5/5] selftests/bpf: sample implementation of a bpf pvsched driver Vineeth Pillai (Google)
2024-04-08 14:01 ` Vineeth Remanan Pillai
2024-04-08 13:54 ` [RFC PATCH v2 0/5] Paravirt Scheduling (Dynamic vcpu priority management) Vineeth Remanan Pillai
2024-05-01 15:29 ` Sean Christopherson [this message]
2024-05-02 13:42 ` Vineeth Remanan Pillai
2024-06-24 11:01 ` Vineeth Remanan Pillai
2024-07-12 12:57 ` Joel Fernandes
2024-07-12 14:09 ` Mathieu Desnoyers
2024-07-12 14:48 ` Sean Christopherson
2024-07-12 15:32 ` Mathieu Desnoyers
2024-07-12 16:14 ` Sean Christopherson
2024-07-12 16:30 ` Steven Rostedt
2024-07-12 16:39 ` Sean Christopherson
2024-07-12 17:02 ` Steven Rostedt
2024-07-12 16:24 ` Steven Rostedt
2024-07-12 16:44 ` Sean Christopherson
2024-07-12 16:50 ` Joel Fernandes
2024-07-12 17:08 ` Sean Christopherson
2024-07-12 17:14 ` Steven Rostedt
2024-07-12 17:12 ` Steven Rostedt
2024-07-16 23:44 ` Sean Christopherson
2024-07-17 0:13 ` Steven Rostedt
2024-07-17 5:16 ` Joel Fernandes
2024-07-17 14:14 ` Sean Christopherson
2024-07-17 14:36 ` Steven Rostedt
2024-07-17 14:52 ` Steven Rostedt
2024-07-17 15:20 ` Steven Rostedt
2024-07-17 17:03 ` Suleiman Souhlal
2024-07-17 20:57 ` Joel Fernandes
2024-07-17 21:00 ` Steven Rostedt
2024-07-17 21:09 ` Joel Fernandes
2024-07-12 16:24 ` Joel Fernandes
2024-07-12 17:28 ` Mathieu Desnoyers
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=ZjJf27yn-vkdB32X@google.com \
--to=seanjc@google.com \
--cc=bp@alien8.de \
--cc=bristot@redhat.com \
--cc=bsegall@google.com \
--cc=dave.hansen@linux.intel.com \
--cc=dietmar.eggemann@arm.com \
--cc=himadrics@inria.fr \
--cc=hpa@zytor.com \
--cc=joel@joelfernandes.org \
--cc=juri.lelli@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mgorman@suse.de \
--cc=mhiramat@kernel.org \
--cc=mingo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=suleiman@google.com \
--cc=tglx@linutronix.de \
--cc=vincent.guittot@linaro.org \
--cc=vineeth@bitbyteword.org \
--cc=vkuznets@redhat.com \
--cc=vschneid@redhat.com \
--cc=wanpengli@tencent.com \
--cc=x86@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