[PATCH] ARM: mm: Fix ARCH_LOW_ADDRESS_LIMIT when CONFIG_ZONE_DMA

Arnd Bergmann arnd at arndb.de
Sat Jun 3 05:59:53 PDT 2023


On Sat, Jun 3, 2023, at 14:38, Russell King (Oracle) wrote:
> On Sat, Jun 03, 2023 at 02:33:49PM +0200, Arnd Bergmann wrote:
>> Changing the low address limit by itself makes the swiotlb work
>> correctly, but for performance we also want to avoid having to
>> use the swiotlb at all when dealing with the zero page.
>
> How often is the zero page used for DMA _to_ a device (it should never
> be used for DMA _from_ a device.) ? It doesn't sound that useful to me,
> since it can only be used for writing zeros.

It's possible that this doesn't happen all that much at all, the
bcm2835-dma driver is the only one that has a specific optimization
for this case, introduced in commit bf75703d0912d ("dmaengine:
bcm2835: Avoid accessing memory when copying zeroes").

If the ZERO page can only be mapped through swiotlb, that
optimization is clearly counterproductive because it requires
making a copy of the zero page but doesn't actually skip
any transfers.

I don't really understand what the spi driver is doing here,
but I can see that it still contains the code that originally
started the discussion about the change to the DMA driver,
so I assume it's still used that way.

     Arnd




More information about the linux-arm-kernel mailing list