From: Sean Christopherson <seanjc@google.com>
To: Xiong Y Zhang <xiong.y.zhang@intel.com>
Cc: "kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"pbonzini@redhat.com" <pbonzini@redhat.com>,
"peterz@infradead.org" <peterz@infradead.org>,
"like.xu.linux@gmail.com" <like.xu.linux@gmail.com>,
"kan.liang@linux.intel.com" <kan.liang@linux.intel.com>,
"zhenyuw@linux.intel.com" <zhenyuw@linux.intel.com>,
Zhiyuan Lv <zhiyuan.lv@intel.com>,
Weijiang Yang <weijiang.yang@intel.com>
Subject: Re: [PATCH 3/4] KVM: VMX/pmu: Enable inactive vLBR event in guest LBR MSR emulation
Date: Tue, 27 Jun 2023 08:07:07 -0700 [thread overview]
Message-ID: <ZJr7GtTFg2uzck1c@google.com> (raw)
In-Reply-To: <MW4PR11MB5824B76276020C1A33A26A72BB27A@MW4PR11MB5824.namprd11.prod.outlook.com>
On Tue, Jun 27, 2023, Xiong Y Zhang wrote:
> > On Sun, Jun 25, 2023, Xiong Y Zhang wrote:
> > > > > On Fri, Jun 16, 2023, Xiong Zhang wrote:
> > > > /*
> > > > * Attempt to re-enable the vLBR event if it was disabled due to
> > > > * contention with host LBR usage, i.e. was put into an error state.
> > > > * Perf doesn't notify KVM if the host stops using LBRs, i.e. KVM needs
> > > > * to manually re-enable the event.
> > > > */
> > > >
> > > > Which begs the question, why can't there be a notification of some
> > > > form that the LBRs are once again available?
> > > This is perf scheduler rule. If pinned event couldn't get resource as
> > > resource limitation, perf will put it into error state and exclude it
> > > from perf scheduler, even if resource available later, perf won't
> > > schedule it again as it is in error state, the only way to reschedule
> > > it is to enable it again. If non-pinned event couldn't get resource
> > > as resource limitation, perf will put it into inactive state, perf
> > > will reschedule it automatically once resource is available. vLBR event is per
> > process pinned event.
> >
> > That doesn't answer my question. I get that all of this is subject to perf
> > scheduling, I'm asking why perf doesn't communicate directly with KVM to
> > coordinate access to LBRs instead of pulling the rug out from under KVM.
> Perf doesn't need such notification interface currently, as non-pinned event
> will be active automatically once resource available, only pinned event is
> still in inactive even if resource available, perf may refuse to add such
> interface for KVM usage only.
Or maybe perf will be overjoyed that someone is finally proposing a coherent
interface. Until we actually try/ask, we'll never know.
> > Your other response[1] mostly answered that question, but I want explicit
> > documentation on the contract between perf and KVM with respect to LBRs. In
> > short, please work with Weijiang to fulfill my request/demand[*] that someone
> > document KVM's LBR support, and justify the "design". I am simply not willing to
> > take KVM LBR patches until that documentation is provided.
> Sure, I will work with Weijiang to supply such documentation. Will this
> document be put in Documentation/virt/kvm/x86/ ?
Ya, Documentation/virt/kvm/x86/pmu.rst please.
next prev parent reply other threads:[~2023-06-27 15:07 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-16 11:33 [PATCH 0/4] Part of fix for host and guest LBR event coexist Xiong Zhang
2023-06-16 11:33 ` [PATCH 1/4] perf/x86/intel: Get shared reg constraints first for vLBR Xiong Zhang
2023-06-28 4:25 ` Like Xu
2023-06-29 2:11 ` Zhang, Xiong Y
2023-06-16 11:33 ` [PATCH 2/4] KVM: VMX/pmu: Save host debugctlmsr just before vm entry Xiong Zhang
2023-06-23 20:15 ` Sean Christopherson
2023-06-25 4:03 ` Zhang, Xiong Y
2023-06-28 5:37 ` Like Xu
2023-06-16 11:33 ` [PATCH 3/4] KVM: VMX/pmu: Enable inactive vLBR event in guest LBR MSR emulation Xiong Zhang
2023-06-23 20:38 ` Sean Christopherson
2023-06-25 6:54 ` Zhang, Xiong Y
2023-06-26 17:00 ` Sean Christopherson
2023-06-27 3:29 ` Zhang, Xiong Y
2023-06-27 15:07 ` Sean Christopherson [this message]
2023-06-28 6:07 ` Like Xu
2023-06-28 5:50 ` Like Xu
2023-06-16 11:33 ` [PATCH 4/4] KVM: selftests: Add test case for guest and host LBR preemption Xiong Zhang
2023-06-28 6:27 ` Like Xu
2023-06-29 2:39 ` Zhang, Xiong Y
2023-06-28 9:27 ` Yang, Weijiang
2023-06-29 2:52 ` Zhang, Xiong Y
2023-06-30 2:05 ` Yang, Weijiang
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=ZJr7GtTFg2uzck1c@google.com \
--to=seanjc@google.com \
--cc=kan.liang@linux.intel.com \
--cc=kvm@vger.kernel.org \
--cc=like.xu.linux@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=peterz@infradead.org \
--cc=weijiang.yang@intel.com \
--cc=xiong.y.zhang@intel.com \
--cc=zhenyuw@linux.intel.com \
--cc=zhiyuan.lv@intel.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;
as well as URLs for NNTP newsgroup(s).