mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Linus Torvalds <torvalds@linux-foundation.org>,
	Eric Dumazet <edumazet@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	Uros Bizjak <ubizjak@gmail.com>,
	x86@kernel.org, linux-kernel <linux-kernel@vger.kernel.org>,
	Eric Dumazet <eric.dumazet@gmail.com>
Subject: Re: [PATCH 2/2] x86/irqflags: Use ASM_OUTPUT_RM in native_save_fl()
Date: Sun, 21 Dec 2025 15:44:13 -0800	[thread overview]
Message-ID: <AB52301D-25E4-429B-9AD1-3EBD348478E1@zytor.com> (raw)
In-Reply-To: <CAHk-=wh3qPK8u8WCgw_ueCkQDP1AtE7AgQxafGR4DKKamuaBkA@mail.gmail.com>

On December 21, 2025 3:20:43 PM PST, Linus Torvalds <torvalds@linux-foundation.org> wrote:
>On Sun, 21 Dec 2025 at 13:47, Eric Dumazet <edumazet@google.com> wrote:
>>
>> Unfortunately I was told it was not better, some clang versions had
>> bugs with it.
>
>The whole "builtin is worse than inline asm" is actually a thing even
>when not actively buggy. We've had things like that a few times
>before.
>
>It's why we have out own variable_ffs() implementation, for example,
>and do things like
>
>   #define ffs(x) (__builtin_constant_p(x) ? __builtin_ffs(x) : variable_ffs(x))
>
>because __builtin_ffs() generates pointlessly silly code on at least
>some compiler versions:
>
>    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106471
>
>So then just using inline asm gets us at least reliable results, and
>we can - and do - tweak it for specific known configs.
>
>             Linus

Sigh.

It's just disappointing to see this kind of stuff.

  reply	other threads:[~2025-12-21 23:44 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-19 11:20 [PATCH 0/2] x86: speedup local_irq_save() for clang Eric Dumazet
2025-12-19 11:20 ` [PATCH 1/2] clang: work around asm output constraint problems Eric Dumazet
2025-12-20 22:32   ` Linus Torvalds
2025-12-21  3:46     ` Eric Dumazet
2025-12-19 11:20 ` [PATCH 2/2] x86/irqflags: Use ASM_OUTPUT_RM in native_save_fl() Eric Dumazet
2025-12-21 21:39   ` H. Peter Anvin
2025-12-21 21:47     ` Eric Dumazet
2025-12-21 23:20       ` Linus Torvalds
2025-12-21 23:44         ` H. Peter Anvin [this message]
2025-12-22  1:38           ` Linus Torvalds
2025-12-22  4:25             ` H. Peter Anvin
2025-12-22 16:51               ` Andrew Cooper

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=AB52301D-25E4-429B-9AD1-3EBD348478E1@zytor.com \
    --to=hpa@zytor.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=ubizjak@gmail.com \
    --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

all inboxes | Powered by JetHome®