From: Peter Zijlstra <peterz@infradead.org>
To: David Woodhouse <dwmw2@infradead.org>
Cc: Alan Cox <gnomes@lxorguk.ukuu.org.uk>,
Linus Torvalds <torvalds@linux-foundation.org>,
Thomas Gleixner <tglx@linutronix.de>,
KarimAllah Ahmed <karahmed@amazon.de>,
sironi@amazon.de, the arch/x86 maintainers <x86@kernel.org>,
KVM list <kvm@vger.kernel.org>,
Paolo Bonzini <pbonzini@redhat.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Borislav Petkov <bp@alien8.de>, Paul Turner <pjt@google.com>
Subject: Re: [PATCH] KVM: x86: Reduce retpoline performance impact in slot_handle_level_range()
Date: Mon, 5 Feb 2018 09:51:24 +0100 [thread overview]
Message-ID: <20180205085124.GF2249@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <1517669207.31953.120.camel@infradead.org>
On Sat, Feb 03, 2018 at 02:46:47PM +0000, David Woodhouse wrote:
> > For the simple case how about wrapping the if into
> >
> > call_likely(foo->bar, usualfunction, args)
> >
> > as a companion to
> >
> > foo->bar(args)
> >
> > that can resolve to nothing special on architectures that don't need it,
> > an if/else case on platforms with spectre, and potentially clever
> > stuff on any platform where you can beat the compiler by knowing
> > probabilities it can't infer ?
>
> Yeah. I'm keen on being able to use something like alternatives to
> *change* 'usualfunction' at runtime though. I suspect it'll be a win
> for stuff like dma_ops.
>
> But I'm also keen to actually base such things on real data, not just
> go randomly "optimising" stuff just because we can. Let's try to make
> sure we fix up the real bottlenecks, and not just go crazy.
Google has a fairly long history of using feedback driven optimization
compiles for the kernel. They were also the ones that developed perf
autofdo tooling IIRC.
https://gcc.gnu.org/wiki/AutoFDO/Tutorial
One of the things pjt promised was a series of patches doing the
proposed optimization for the scheduler code based on their results.
next prev parent reply other threads:[~2018-02-05 8:51 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-02 14:59 [PATCH] KVM: x86: Reduce retpoline performance impact in slot_handle_level_range() David Woodhouse
2018-02-02 15:43 ` Sironi, Filippo
2018-02-02 21:10 ` Paolo Bonzini
2018-02-02 21:14 ` David Woodhouse
2018-02-02 18:50 ` Linus Torvalds
2018-02-02 19:10 ` Linus Torvalds
2018-02-02 19:17 ` David Woodhouse
2018-02-02 21:23 ` Alan Cox
2018-02-03 14:46 ` David Woodhouse
2018-02-05 8:51 ` Peter Zijlstra [this message]
2018-02-05 8:55 ` Peter Zijlstra
2018-02-05 15:15 ` Paolo Bonzini
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=20180205085124.GF2249@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=bp@alien8.de \
--cc=dwmw2@infradead.org \
--cc=gnomes@lxorguk.ukuu.org.uk \
--cc=karahmed@amazon.de \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=pjt@google.com \
--cc=sironi@amazon.de \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--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