From: "Arnd Bergmann" <arnd@arndb.de>
To: "Kent Overstreet" <kent.overstreet@linux.dev>,
"Russell King" <linux@armlinux.org.uk>
Cc: "Calvin Owens" <jcalvinowens@gmail.com>,
"Dave Martin" <Dave.Martin@arm.com>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
"linux-bcachefs@vger.kernel.org" <linux-bcachefs@vger.kernel.org>
Subject: Re: [PATCH] arm: Silence gcc warnings about arch ABI drift
Date: Mon, 19 Feb 2024 10:57:46 +0100 [thread overview]
Message-ID: <7299839b-06e6-40eb-8024-93ed5f9b733f@app.fastmail.com> (raw)
In-Reply-To: <xs2splnjhlj257uca5yae64fp4solc4ugbxrkczoyd75n42r66@42boyzdcmyj4>
On Mon, Feb 19, 2024, at 10:40, Kent Overstreet wrote:
> On Mon, Feb 19, 2024 at 09:26:51AM +0000, Russell King (Oracle) wrote:
>> On Mon, Feb 19, 2024 at 07:21:11AM +0100, Arnd Bergmann wrote:
>>
>> +1 - bcachefs definitely needs fixing. Passing all that as an argument
>> not only means that it has to be read into registers, but also when
>> accessing members, it has to be extracted from those registers as well.
>>
>> Passing that by argument is utterly insane.
>
> If the compiler people can't figure out a vaguely efficient way to pass
> a small struct by value, that's their problem - from the way you
> describe it, I have to wonder at what insanity is going on there.
On most ABIs, there are only six argument registers (24 bytes)
for function calls. The compiler has very little choice here if
it tries to pass 32 bytes worth of data.
On both x86_64 and arm64, there are theoretically enough
registers to pass the data, but kernel disallows using the
vector and floating point registers for passing large
compounds arguments.
The integer registers on x86 apparently allow passing compounds
up to 16 bytes, but only if all members are naturally aligned.
Since you have both __packed members and bitfields, the compiler
would not even be allowed to pass the structure efficiently
even if it was small enough.
Arnd
next prev parent reply other threads:[~2024-02-19 9:58 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <fe51512baa18e1480ce997fc535813ce6a0b0721.1708286962.git.jcalvinowens@gmail.com>
2024-02-19 6:21 ` [PATCH] arm: Silence gcc warnings about arch ABI drift Arnd Bergmann
2024-02-19 6:25 ` Kent Overstreet
2024-02-19 7:56 ` Arnd Bergmann
2024-02-19 6:58 ` Calvin Owens
2024-02-19 7:03 ` Kent Overstreet
2024-02-19 7:36 ` Calvin Owens
2024-02-19 7:42 ` Kent Overstreet
2024-02-19 9:26 ` Russell King (Oracle)
2024-02-19 9:40 ` Kent Overstreet
2024-02-19 9:52 ` Russell King (Oracle)
2024-02-19 9:56 ` Kent Overstreet
2024-02-19 19:53 ` David Laight
2024-02-19 21:38 ` Kent Overstreet
2024-02-19 22:04 ` David Laight
2024-02-19 9:57 ` Arnd Bergmann [this message]
2024-02-19 10:08 ` Kent Overstreet
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=7299839b-06e6-40eb-8024-93ed5f9b733f@app.fastmail.com \
--to=arnd@arndb.de \
--cc=Dave.Martin@arm.com \
--cc=jcalvinowens@gmail.com \
--cc=kent.overstreet@linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-bcachefs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
/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