[PATCH v2 0/2] mm: Allow kmalloc() allocations below ARCH_KMALLOC_MINALIGN

Greg Kroah-Hartman gregkh at linuxfoundation.org
Tue Oct 25 23:54:19 PDT 2022


On Tue, Oct 25, 2022 at 09:52:45PM +0100, Catalin Marinas wrote:
> To me, the ideal approach would be __dma annotations on pointers aimed
> at DMA and using kernel tools like sparse to identify them.

As a reviewer of drivers, and a subsystem maintainer, yes, I too would
like this instead.  It would make it much more obvious what is
happening.

> dma_kmalloc() would return such pointers. However, things get muddier
> with scatterlists since functions like sg_set_page() don't have any such
> pointer information (can we mark the offset as __dma instead?).

Drivers don't always call dma_kmalloc() for pointers to pass to dma
controllers.  Heck, I doubt the majority do that at all today, that's
the main problem overall that you are having.

We can take the time and move the kernel to do this, perhaps that is the
real solution that will work best over time here?

thanks,

greg k-h



More information about the linux-arm-kernel mailing list