From: Ingo Molnar <mingo@kernel.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Jakub Jelinek <jakub@redhat.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
Richard Henderson <rth@redhat.com>,
Vladimir Makarov <vmakarov@redhat.com>,
"H. Peter Anvin" <hpa@zytor.com>,
Thomas Gleixner <tglx@linutronix.de>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Borislav Petkov <bp@alien8.de>
Subject: Re: [PATCH] x86: Optimize variable_test_bit()
Date: Fri, 1 May 2015 19:17:28 +0200 [thread overview]
Message-ID: <20150501171728.GD1657@gmail.com> (raw)
In-Reply-To: <20150501164639.GA19158@dyad.arnhem.chello.nl>
* Peter Zijlstra <peterz@infradead.org> wrote:
> On Fri, May 01, 2015 at 06:33:29PM +0200, Jakub Jelinek wrote:
> > On Fri, May 01, 2015 at 09:03:32AM -0700, Linus Torvalds wrote:
> > > > PPS. Jakub, I see gcc5.1 still hasn't got output operands for asm goto;
> > > > is this something we can get 'fixed' ?
> >
> > CCing Richard as author of asm goto and Vlad as register allocator
> > maintainer. There are a few enhancement requests to support this,
> > like http://gcc.gnu.org/PR59615 and http://gcc.gnu.org/PR52381 ,
> > but indeed the reason why no outputs are allowed is the register
> > allocation issue. Don't know if LRA would be better suited to
> > handle that case, but it would indeed be pretty hard.
>
> So it would b awesome if we could use these freshly modeled flags as
> output for regular asm stmts; that would obviate much of the asm
> goto hackery we now do/have and allow gcc to pick the right branch
> for likely/unlikely.
If I may hijack the discussion a bit: it would also be awesome if
there was a GCC flag that would allow us to use __builtin_expect()
hints even when automatic branch heuristics are disabled:
I.e. very similar to -fno-guess-branch-probability, just that explicit
__builtin_expect() hints would not be ignored (like
-fno-guess-branch-probability does it today).
We could use this to compress the kernel instruction cache footprint
by about 5% on x86-64, while still having all the hand-made
optimizations that __builtin_expect() allows us.
It would be a perfect solution if -fno-guess-branch-probability just
stopped ignoring __builtin_expect().
Thanks,
Ingo
next prev parent reply other threads:[~2015-05-01 17:17 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-01 15:16 [PATCH] x86: Optimize variable_test_bit() Peter Zijlstra
2015-05-01 16:03 ` Linus Torvalds
2015-05-01 16:16 ` Peter Zijlstra
2015-05-01 16:29 ` Peter Zijlstra
2015-05-01 16:18 ` Peter Zijlstra
2015-05-01 16:33 ` Jakub Jelinek
2015-05-01 16:45 ` Linus Torvalds
2015-05-01 16:46 ` Peter Zijlstra
2015-05-01 17:17 ` Ingo Molnar [this message]
2015-05-01 19:02 ` Vladimir Makarov
2015-05-01 20:49 ` Linus Torvalds
2015-05-01 22:22 ` Vladimir Makarov
2015-05-02 12:39 ` Peter Zijlstra
2015-05-04 15:37 ` Richard Henderson
2015-05-04 19:33 ` [RFC] Design for flag bit outputs from asms Richard Henderson
2015-05-04 20:14 ` H. Peter Anvin
2015-05-04 20:27 ` H. Peter Anvin
2015-05-04 20:33 ` Richard Henderson
2015-05-04 20:45 ` Linus Torvalds
2015-05-04 20:57 ` Richard Henderson
2015-05-04 21:23 ` H. Peter Anvin
2015-05-04 20:35 ` Linus Torvalds
2015-05-04 20:42 ` H. Peter Anvin
2015-05-05 9:01 ` Gabriel Paubert
2015-05-05 13:50 ` Segher Boessenkool
2015-05-05 15:37 ` Linus Torvalds
2015-05-05 16:10 ` Segher Boessenkool
2015-05-02 12:43 ` [PATCH] x86: Optimize variable_test_bit() Peter Zijlstra
2015-05-04 18:07 ` Vladimir Makarov
2015-05-04 20:14 ` H. Peter Anvin
2015-05-04 13:42 ` Peter Zijlstra
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=20150501171728.GD1657@gmail.com \
--to=mingo@kernel.org \
--cc=bp@alien8.de \
--cc=hpa@zytor.com \
--cc=jakub@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=rth@redhat.com \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=vmakarov@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.