From: Segher Boessenkool <segher@kernel.crashing.org>
To: Gabriel Paubert <paubert@iram.es>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Nicholas Piggin <npiggin@gmail.com>,
Zhouyi Zhou <zhouzhouyi@gmail.com>,
"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>
Subject: Re: [PATCH v2] powerpc: Fix irq_soft_mask_set() and irq_soft_mask_return() with sanitizer
Date: Thu, 1 Sep 2022 13:07:51 -0500 [thread overview]
Message-ID: <20220901180751.GH25951@gate.crashing.org> (raw)
In-Reply-To: <YxBhRtTuJ4Ut7wUt@lt-gp.iram.es>
On Thu, Sep 01, 2022 at 09:37:42AM +0200, Gabriel Paubert wrote:
> On Thu, Sep 01, 2022 at 05:22:32AM +0000, Christophe Leroy wrote:
> > Le 01/09/2022 à 00:45, Segher Boessenkool a écrit :
> > > I would have used real assembler code here (in a .s file). But there
> > > probably are reasons to do things this way, performance probably?
> >
> > We changed it to inline asm in order to ... inline it in the caller.
>
> And there is a single caller it seems. Typically GCC inlines function
> with a single call site, but it may be confused by asm statements.
"Confused"... It might estimate the assembler statement to be
significantly more expensive than it really is. The compiler has to be
somewhat conservative, to be able to generate code that can be assembled
without errors. It counts instructions by counting newlines and semis
and that kind of thing. Since GCC 7 there is "asm inline", to make the
compiler think for inlining purposes that the asm outputs minimum size
code. You can use asm_inline in the kernel for this.
> > I also find that those operand names make it awull more difficult to
> > read that traditional numbering. I really dislike that new trend.
Yup. All the extra markup it needs doesn't benefit readability either.
> > And same with those // comments, better use meaningfull C variable names.
I wrote:
> > > Comments like "// Inputs" are just harmful. As is the "creative"
> > > indentation here. Both harm readability and do not help understanding
> > > in any other way either.
This is a comment trying to explain (GNU) C syntax. I certainly agree
that variable naming is very important, but this was meant as commentary
on a worse comment offence :-)
Segher
next prev parent reply other threads:[~2022-09-01 18:13 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-23 16:39 [PATCH v2] powerpc: Fix irq_soft_mask_set() and irq_soft_mask_return() with sanitizer Christophe Leroy
2022-08-30 5:15 ` Nicholas Piggin
2022-08-30 5:24 ` Christophe Leroy
2022-08-30 9:01 ` Nicholas Piggin
2022-08-30 9:10 ` Christophe Leroy
2022-08-31 22:45 ` Segher Boessenkool
2022-09-01 5:22 ` Christophe Leroy
2022-09-01 7:37 ` Gabriel Paubert
2022-09-01 7:47 ` Christophe Leroy
2022-09-01 17:48 ` Segher Boessenkool
2022-09-01 18:07 ` Segher Boessenkool [this message]
2022-09-02 15:57 ` Peter Bergner
2022-09-02 17:10 ` Segher Boessenkool
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=20220901180751.GH25951@gate.crashing.org \
--to=segher@kernel.crashing.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=npiggin@gmail.com \
--cc=paubert@iram.es \
--cc=zhouzhouyi@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 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).