linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Ingo Molnar <mingo@kernel.org>, Jan Beulich <JBeulich@suse.com>,
	tglx@linutronix.de, linux-kernel@vger.kernel.org
Subject: Re: [tip:x86/asm] x86: Prefer TZCNT over BFS
Date: Mon, 17 Sep 2012 10:05:25 -0700	[thread overview]
Message-ID: <50575855.8040308@zytor.com> (raw)
In-Reply-To: <CA+55aFwKkW7+Xv4-36JsbR7rDyorC8xcTsL_XnYCq=XNTZeJFw@mail.gmail.com>

On 09/17/2012 10:00 AM, Linus Torvalds wrote:
\>
> As Jan already pointed out, I really want more than that.
> 
> The *conditions* for selecting X86_TZCNT have to be sane too.
> 
> I really think that "32-bit generic kernel" is totally and completely
> a wrong choice for enabling this. A 32-bit setup has exactly two
> relevant cases:
> 
>  - old CPU's that don't support TZCNT anyway
>  - new CPU's where the user doesn't care about performance (things
> like HIGHMEM will have killed it much more than TZCNT etc ever will)
> 
> and in neither case is the TZCNT instruction relevant.
> 
> Even for the 64-bit case, I really don't see why "generic" should pick
> it up either. The fact that we don't have many CPU optimization
> choices for x86-64 is not an excuse to then overload "generic" with
> that kind of choice, I think.
> 
> So I really objected not only to the ugly and unreadable conditionals,
> I objected to the criteria for them too.
> 

Honestly, I don't see a reason to not do this unconditionally.  On
anything but (pre-686-era) extremely old CPUs the cost of the extra
prefix is zero.  On the really old CPUs the cost of the BSF instruction
will dwarf the penalty cycle for the extra prefix, so the whole
mechanism around doing it conditionally seems pointless.

	-hpa



  reply	other threads:[~2012-09-17 17:06 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
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 [this message]
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=50575855.8040308@zytor.com \
    --to=hpa@zytor.com \
    --cc=JBeulich@suse.com \
    --cc=linux-kernel@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).