mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Xin Li <xin3.li@intel.com>, Xin Li <xin@zytor.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Cc: "x86@kernel.org" <x86@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <peterz@infradead.org>
Subject: Re: RFC, untested: handing of MSR immediates and MSRs on Xen
Date: Wed, 23 Oct 2024 14:52:56 -0700	[thread overview]
Message-ID: <9f939484-18bc-42be-bd1b-ef48d3366a69@zytor.com> (raw)
In-Reply-To: <7a4de623-ecda-4369-a7ae-0c43ef328177@zytor.com>

On 10/23/24 14:31, H. Peter Anvin wrote:
> 
> Note: I haven't added tracepoint handling yet. *Ideally* tracepoints 
> would be patched over the main callsite instead of using a separate 
> static_key() -- which also messes up register allocation due to the 
> subsequent call. This is a general problem with tracepoints which 
> perhaps is better handled separately.
> 

So I have never quite wrapped my head around how heavyweight tracepoints 
actually are. I do know that static_key() is definitely not a perfect 
optimization barrier[*].

The case of MSR tracepoints in particular concerns me, because having 
one knob for all MSRs is an *incredibly* wide net to cast, and doesn't 
distinguish in any way between performance-sensitive and 
non-performance-sensitive MSRs.

I do wonder if tracepoint sites could be implemented using traps (or 
perhaps better, software interrupts) especially in critical flows, or if 
that would increase the cost of the tracing too much.

	-hpa


[*] One thing we may want to consider in general is if we should 
increase the bias for __builtin_expect() by passing 
-fbuiltin-expect-probability to gcc, or use 
__builtin_expect_with_probability().



      parent reply	other threads:[~2024-10-23 21:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-23 21:31 H. Peter Anvin
2024-10-23 21:34 ` H. Peter Anvin
2024-10-23 22:08   ` Uros Bizjak
2024-10-23 23:05     ` H. Peter Anvin
2024-10-23 21:52 ` H. Peter Anvin [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=9f939484-18bc-42be-bd1b-ef48d3366a69@zytor.com \
    --to=hpa@zytor.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=x86@kernel.org \
    --cc=xin3.li@intel.com \
    --cc=xin@zytor.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®