public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Mi, Dapeng" <dapeng1.mi@linux.intel.com>
To: Sean Christopherson <seanjc@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Kan Liang <kan.liang@linux.intel.com>,
	Jim Mattson <jmattson@google.com>,
	Jinrong Liang <cloudliang@tencent.com>,
	Aaron Lewis <aaronlewis@google.com>,
	Dapeng Mi <dapeng1.mi@intel.com>
Subject: Re: [PATCH] KVM: selftests: Test top-down slots event
Date: Fri, 2 Feb 2024 09:38:50 +0800	[thread overview]
Message-ID: <95c3dc22-2d40-46fc-bc4d-8206b002e0a1@linux.intel.com> (raw)
In-Reply-To: <Zbvcx0A-Ln2sP6XA@google.com>


On 2/2/2024 2:02 AM, Sean Christopherson wrote:
> On Thu, Feb 01, 2024, Dapeng Mi wrote:
>> Although the fixed counter 3 and the exclusive pseudo slots events is
>> not supported by KVM yet, the architectural slots event is supported by
>> KVM and can be programed on any GP counter. Thus add validation for this
>> architectural slots event.
>>
>> Top-down slots event "counts the total number of available slots for an
>> unhalted logical processor, and increments by machine-width of the
>> narrowest pipeline as employed by the Top-down Microarchitecture
>> Analysis method." So suppose the measured count of slots event would be
>> always larger than 0.
> Please translate that into something non-perf folks can understand.  I know what
> a pipeline slot is, and I know a dictionary's definition of "available" is, but I
> still have no idea what this event actually counts.  In other words, I want a
> precise definition of exactly what constitutes an "available slot", in verbiage
> that anyone with basic understanding of x86 architectures can follow after reading
> the whitepaper[*], which is helpful for understanding the concepts, but doesn't
> crisply explain what this event counts.
>
> Examples of when a slot is available vs. unavailable would be extremely helpful.
>
> [*] https://www.intel.com/content/www/us/en/docs/vtune-profiler/cookbook/2023-0/top-down-microarchitecture-analysis-method.html

Yeah, indeed, 'slots' is not easily understood from its literal meaning. 
I also took some time to understand it when I look at this event for the 
first time. Simply speaking, slots is an abstract concept which 
indicates how many uops (decoded from instructions) can be processed 
simultaneously (per cycle) on HW. we assume there is a classic 5-stage 
pipeline, fetch, decode, execute, memory access and register writeback. 
In topdown micro-architectural analysis method, the former two stages 
(fetch/decode) is called front-end and the last three stages are called 
back-end.

In modern Intel processors, a complicated instruction could be decoded 
into several uops (micro-operations) and so these uops can be processed 
simultaneously and then improve the performance. Thus, assume a 
processor can decode and dispatch 4 uops in front-end and execute 4 uops 
in back-end simultaneously (per-cycle), so we would say this processor 
has 4 topdown slots per-cycle. If a slot is spare and can be used to 
process new uop, we say it's available, but if a slot is occupied by a 
uop for several cycles and not retired (maybe blocked by memory access), 
we say this slot is stall and unavailable.

Ok, I would rewrite the commit description and add more explanation there.


  reply	other threads:[~2024-02-02  1:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-01  6:15 [PATCH] KVM: selftests: Test top-down slots event Dapeng Mi
2024-02-01 18:02 ` Sean Christopherson
2024-02-02  1:38   ` Mi, Dapeng [this message]
2024-02-02 17:24     ` Sean Christopherson
2024-02-18  3:16       ` Mi, Dapeng

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=95c3dc22-2d40-46fc-bc4d-8206b002e0a1@linux.intel.com \
    --to=dapeng1.mi@linux.intel.com \
    --cc=aaronlewis@google.com \
    --cc=cloudliang@tencent.com \
    --cc=dapeng1.mi@intel.com \
    --cc=jmattson@google.com \
    --cc=kan.liang@linux.intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.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