From: John David Anglin <dave.anglin@bell.net>
To: Mikulas Patocka <mpatocka@redhat.com>
Cc: John David Anglin <dave@parisc-linux.org>,
James Bottomley <James.Bottomley@HansenPartnership.com>,
Helge Deller <deller@gmx.de>,
linux-parisc@vger.kernel.org
Subject: Re: ARCH_DMA_MINALIGN on PA-RISC
Date: Thu, 25 Jul 2024 17:29:09 -0400 [thread overview]
Message-ID: <b3254b3c-438a-473a-87a4-b627ec706d2f@bell.net> (raw)
In-Reply-To: <436be3ae-a1b8-a14d-88f9-447355959064@redhat.com>
On 2024-07-25 4:36 p.m., Mikulas Patocka wrote:
>
> On Thu, 25 Jul 2024, John David Anglin wrote:
>
>> On 2024-07-25 3:13 p.m., John David Anglin wrote:
>>>> L1_CACHE_BYTES is a performance hint that is used to avoid cache line
>>>> ping-pong when multiple CPUs modify nearby data.
>>> Our L1_CACHE_BYTES define is wrong. PA7100 has a L1 length of 16 bytes.
>>> PA7200 to PA7300LC have a length of 32 bytes. PA8000 to PA8700 have a length of 64
>>> bytes. PA8800 and PA8900 have a L1 length of 128 bytes (this is from ERS D_Stride).
>>>
>> The attached patch fixes the defines for L1_CACHE_SHIFT, L1_CACHE_BYTES and
>> ARCH_DMA_MINALIGN. I left ARCH_DMA_MINALIGN at 16 as I believe this gives
>> 128-byte alignment.
>>
>> Testing.
>>
>> Dave
>>
>> --
>> John David Anglin dave.anglin@bell.net
> How does ARCH_DMA_MINALIGN == 16 give 128-byte alignment? I think that
> ARCH_DMA_MINALIGN needs to be 128 to avoid the possibility of DMA transfer
> corruption.
You are right. It should be 128.
>
> L1_CACHE_SHIFT can be set to arbitrary value - setting it badly could
> degrade performance, but it shouldn't cause data corruption.
If we set to an arbitrary value, we need to document why we do it. The naming
suggests that L1_CACHE_BYTES should be the L1 cache length.
>
> The commit d93277b9839b0bde06238a7a7f644114edb2ad4a says that setting
> L1_CACHE_SHIFT == 7 causes networking performance degradation on arm64. I
> don't know how much is this related to parisc.
Some other architectures have L1_CACHE_SHIFT == 7.
Dave
--
John David Anglin dave.anglin@bell.net
next prev parent reply other threads:[~2024-07-25 21:35 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-24 18:17 ARCH_DMA_MINALIGN on PA-RISC Mikulas Patocka
2024-07-24 18:48 ` John David Anglin
2024-07-24 19:25 ` James Bottomley
2024-07-25 16:45 ` John David Anglin
2024-07-25 17:27 ` Mikulas Patocka
2024-07-25 17:43 ` James Bottomley
2024-07-25 17:46 ` Mikulas Patocka
2024-07-25 19:19 ` James Bottomley
2024-07-25 19:13 ` John David Anglin
2024-07-25 20:05 ` John David Anglin
2024-07-25 20:36 ` Mikulas Patocka
2024-07-25 21:29 ` John David Anglin [this message]
2024-07-27 10:24 ` Mikulas Patocka
2024-07-27 15:06 ` John David Anglin
2024-07-25 17:37 ` Mikulas Patocka
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=b3254b3c-438a-473a-87a4-b627ec706d2f@bell.net \
--to=dave.anglin@bell.net \
--cc=James.Bottomley@HansenPartnership.com \
--cc=dave@parisc-linux.org \
--cc=deller@gmx.de \
--cc=linux-parisc@vger.kernel.org \
--cc=mpatocka@redhat.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