From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Eric Dumazet <edumazet@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
Thomas Gleixner <tglx@linutronix.de>,
linux-kernel <linux-kernel@vger.kernel.org>,
Eric Dumazet <eric.dumazet@gmail.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org, Marco Elver <elver@google.com>,
Uros Bizjak <ubizjak@gmail.com>
Subject: Re: [PATCH] locking/local_lock: Reduce local_[un]lock_nested_bh() overhead
Date: Wed, 11 Mar 2026 16:55:39 +0100 [thread overview]
Message-ID: <20260311155539.3Aikrlaz@linutronix.de> (raw)
In-Reply-To: <CANn89iKyPZUqmirYza5ewD2dBQfZCMunG771x7cMpUFkvw9x9w@mail.gmail.com>
On 2026-03-09 15:52:34 [+0100], Eric Dumazet wrote:
> > +void ericeric(void);
> > +void ericeric(void)
> > +{
> > + raw_cpu_read_long(this_cpu_off);
> > + raw_cpu_read_long(this_cpu_off);
> > +}
> >
> > I am guessing __raw_cpu_read() is forcing the asm ?
>
> Might be a clang issue. Oh well.
So the difference is that with gcc we have USE_X86_SEG_SUPPORT and with
llvm we don't. This leads to two asm statements with LLVM of which only
one is eliminated. This optimisation origins in commit ca4256348660c
("x86/percpu: Use C for percpu read/write accessors").
__seg_fs and __seg_gs is supported by LLVM but enabling it leads to tons
warnings and aborts later.
Is there something missing in LLVM? The generated code for
raw_cpu_read_long(this_cpu_off) looks fine.
Sebastian
next prev parent reply other threads:[~2026-03-11 15:55 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-09 12:20 [PATCH] locking/local_lock: Reduce local_[un]lock_nested_bh() overhead Eric Dumazet
2026-03-09 13:43 ` Peter Zijlstra
2026-03-09 13:49 ` Eric Dumazet
2026-03-09 14:05 ` Marco Elver
2026-03-09 14:11 ` Eric Dumazet
2026-03-09 14:03 ` Eric Dumazet
2026-03-09 14:18 ` Eric Dumazet
2026-03-09 14:52 ` Eric Dumazet
2026-03-11 15:55 ` Sebastian Andrzej Siewior [this message]
2026-03-11 16:32 ` Uros Bizjak
2026-03-11 16:45 ` Uros Bizjak
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=20260311155539.3Aikrlaz@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=edumazet@google.com \
--cc=elver@google.com \
--cc=eric.dumazet@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=ubizjak@gmail.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.