From: Julian Vetter <julian@outer-limits.org>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
Madhavan Srinivasan <maddy@linux.ibm.com>,
Michael Ellerman <mpe@ellerman.id.au>,
Nicholas Piggin <npiggin@gmail.com>,
Christophe Leroy <christophe.leroy@csgroup.eu>,
Naveen N Rao <naveen@kernel.org>,
linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] powerpc: Remove eieio() in PowerPC IO functions
Date: Wed, 29 Jan 2025 14:12:32 +0100 [thread overview]
Message-ID: <4994ffc2-d662-42cf-9099-ccddaf4ec22c@outer-limits.org> (raw)
In-Reply-To: <20250129111406.GW20626@gate.crashing.org>
On 29.01.25 12:14, Segher Boessenkool wrote:
> On Wed, Jan 29, 2025 at 10:45:10AM +0100, Julian Vetter wrote:
>> Remove the eieio() calls in IO functions for PowerPC. While other
>> architectures permit prefetching, combining, and reordering, the eieio()
>> calls on PowerPC prevent such optimizations.
>
> Yes, and it is crucial to prevent combining, it is part of the semantics
> of these functions. This is a much bigger problem on PowerPC than on
> architectures which optimise memory accesses much less. So most other
> archs can get away with it much easier (but it is still completely wrong
> there).
>
> You are keeping the trap;isync things, which a) have a way bigger
> performance impact, and b) are merely a debugging aid (if some i/o
> access kills the system, it will be clear where that came from). And
> that isn't even the biggest thing of course, there is a heavyweight
> sync in there as well. Is there any benefit to this patch, or is it
> only sabotage?
>
Hello Segher,
thank you for your explanation. Yes, indeed, it was a bit rude to just
send this patch out of the blue. I should have explained what the
purpose of this patch was in the first place. I would like to align
"most" arch specific implementations of memcpy_fromio, memcpy_toio, and
memset_io, so they can all use the one from lib/iomem_copy.c instead of
having all their own. So, I wanted to first bring the implementation on,
e.g., powerpc closer to the "generic" one. Because I had the impression
that it's very similar, except this eieio() after every read.
But if it's really mandatory to have these eieio() instructions, then
the alternative be to either keep the powerpc implementation or add a
generic '#define __io_mbr' (or different name) that is called after
every read and resolves to eieio() on powerpc, and maybe to nothing or
something else on other architectures.
Julian
>
> Segher
next prev parent reply other threads:[~2025-01-29 13:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-29 9:45 [PATCH v2] powerpc: Remove eieio() in PowerPC IO functions Julian Vetter
2025-01-29 11:14 ` Segher Boessenkool
2025-01-29 13:12 ` Julian Vetter [this message]
2025-01-31 9:37 ` Arnd Bergmann
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=4994ffc2-d662-42cf-9099-ccddaf4ec22c@outer-limits.org \
--to=julian@outer-limits.org \
--cc=arnd@arndb.de \
--cc=christophe.leroy@csgroup.eu \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=mpe@ellerman.id.au \
--cc=naveen@kernel.org \
--cc=npiggin@gmail.com \
--cc=segher@kernel.crashing.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).