linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: mingo@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org,
	JBeulich@suse.com, tglx@linutronix.de,
	linux-tip-commits@vger.kernel.org
Subject: Re: [tip:x86/asm] x86: Prefer TZCNT over BFS
Date: Fri, 14 Sep 2012 23:32:39 +0200	[thread overview]
Message-ID: <20120914213239.GB29307@liondog.tnic> (raw)
In-Reply-To: <CA+55aFxs3FUETs830p-ow29RDibu9=d77gxqaueX-wZyr8-40A@mail.gmail.com>

On Fri, Sep 14, 2012 at 02:14:57PM -0700, Linus Torvalds wrote:
> On Thu, Sep 13, 2012 at 11:23 PM, tip-bot for Jan Beulich
> <JBeulich@suse.com> wrote:
> >
> > x86: Prefer TZCNT over BFS
> 
> This patch is insane.
> 
> > For the moment, only do this when the respective generic-CPU
> > option is selected (as there are no specific-CPU options
> > covering the CPUs supporting TZCNT), and don't do that when size
> > optimization was requested.
> 
> This is pure garbage.
> 
> Anybody who thinks this:
> 
> > +#if (defined(CONFIG_X86_GENERIC) || defined(CONFIG_GENERIC_CPU)) \
> > +    && !defined(CONFIG_CC_OPTIMIZE_FOR_SIZE)
> 
> is a good idea should be shot. Don't do it.
> 
> Introduce a new CONFIG variable with a sane name, for chrissake, the
> same way we have CONFIG_X86_XADD etc. It would be logical to call it
> X86_TZCNT, wouldn't it?
> 
> And then add sane rules for that in the x86 config file. And no, the
> above is *NOT* a sane rule at all. If I read that right, it will
> enable TZCNT even for old 32-bit CPU's, for example. That's just
> f*cking insane.
> 
> Stop this kind of idiocy. The code looks bad, and the logic is pure shit too.

And the other important question is, is this even worth the complexity?
I mean "may execute that faster than 'bsf ...'" doesn't mean a lot so
can anyone remind me again why we're doing this?

Any hot paths I've missed?

Thanks.

-- 
Regards/Gruss,
    Boris.

  reply	other threads:[~2012-09-14 21:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-10 11:24 [PATCH] x86: prefer tzcnt over bsf Jan Beulich
2012-09-14  6:23 ` [tip:x86/asm] x86: Prefer TZCNT over BFS tip-bot for Jan Beulich
2012-09-14 21:14   ` Linus Torvalds
2012-09-14 21:32     ` Borislav Petkov [this message]
2012-09-17  7:41     ` Jan Beulich
2012-09-17 10:00       ` Ingo Molnar
2012-09-17 10:58         ` Jan Beulich
2012-09-17 17:00         ` Linus Torvalds
2012-09-17 17:05           ` H. Peter Anvin
2012-09-17 17:13             ` Linus Torvalds
2012-09-18  6:40             ` Jan Beulich

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=20120914213239.GB29307@liondog.tnic \
    --to=bp@alien8.de \
    --cc=JBeulich@suse.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.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;
as well as URLs for NNTP newsgroup(s).