[PATCH v3 00/13] mm, dma, arm64: Reduce ARCH_KMALLOC_MINALIGN to 8

Catalin Marinas catalin.marinas at arm.com
Tue May 16 10:19:43 PDT 2023


On Mon, May 15, 2023 at 12:09:12PM -0700, Isaac Manjarres wrote:
> On Wed, Apr 19, 2023 at 05:06:04PM +0100, Catalin Marinas wrote:
> > I rebased it locally but the last stumbling block is sorting out the
> > iommu bouncing. I was hoping Robin Murphy can lend a hand but he's been
> > busy with other bits. I'll repost the series at 6.4-rc1.
> Hey Catalin, just following up on this. I think it might be worthwhile
> to split this series into two series:
> 
> Series 1: Decouple ARCH_KMALLOC_MINALIGN from ARCH_DMA_MINALIGN,
> and use the cacheline size to determine the minimum kmalloc
> alignment.
> 
> Series 2: Lower the minimum kmalloc alignment to 8 bytes by adding
> support for using SWIOTLB to bounce unaligned kmalloc buffers for DMA
> transactions.
> 
> Dividing the patches as such has the advantage of lowering the minimum
> kmalloc alignment to 64 bytes on many ARM64 systems while the work for
> lowering the minimum alignment to 8 bytes proceeds. This provides a
> noticeable decrease in the slab memory footprint (e.g. I observed a 15
> MB decrease in slab usage on a device I was using).

I attempted "series 1" some time ago and the discussion led to the
combined approach (i.e. don't bother with limiting kmalloc minimum
alignment to cache_line_size() but instead bounce those small buffers).
In my series, I still have this fallback in case there's no swiotlb
buffer.

I'll post a new series this week (including DMA bouncing) but I'll try
to move the bouncing towards the end of the series in case there are
more discussions around this, at least the first part could be picked
up.

-- 
Catalin



More information about the linux-arm-kernel mailing list