[PATCH v4 00/15] mm, dma, arm64: Reduce ARCH_KMALLOC_MINALIGN to 8

Catalin Marinas catalin.marinas at arm.com
Thu May 18 11:50:30 PDT 2023


On Thu, May 18, 2023 at 08:13:08PM +0200, Ard Biesheuvel wrote:
> On Thu, 18 May 2023 at 19:56, Linus Torvalds
> <torvalds at linux-foundation.org> wrote:
> >
> > On Thu, May 18, 2023 at 10:34 AM Catalin Marinas
> > <catalin.marinas at arm.com> wrote:
> > >
> > > That's the fourth version of the series reducing the kmalloc() minimum
> > > alignment on arm64 to 8 (from 128).
> 
> For the series:
> 
> Tested-by: Ard Biesheuvel <ardb at kernel.org> # tx2
[...]
> The box is fully DMA coherent, of course, so this doesn't really tell
> us whether the swiotlb DMA bouncing stuff works or not.

Thanks.

On TX2, I forced the bouncing with:

diff --git a/include/linux/dma-map-ops.h b/include/linux/dma-map-ops.h
index 43bf50c35e14..9006bf680db0 100644
--- a/include/linux/dma-map-ops.h
+++ b/include/linux/dma-map-ops.h
@@ -296,7 +296,7 @@ static inline bool dma_kmalloc_safe(struct device *dev,
	 * is coherent or the direction is DMA_TO_DEVICE (non-desctructive
	 * cache maintenance and benign cache line evictions).
	 */
-	if (dev_is_dma_coherent(dev) || dir == DMA_TO_DEVICE)
+	if (/*dev_is_dma_coherent(dev) || */dir == DMA_TO_DEVICE)
		return true;
 
	return false;

-- 
Catalin



More information about the linux-arm-kernel mailing list