lkml.org 
[lkml]   [2019]   [Dec]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH v1] devres: align devres.data strictly only for devm_kmalloc()
On Tue, Dec 17, 2019 at 04:30:54PM +0100, Marc Gonzalez wrote:
> Commit a66d972465d15 ("devres: Align data[] to ARCH_KMALLOC_MINALIGN")
> increased the alignment of devres.data unconditionally.
>
> Some platforms have very strict alignment requirements for DMA-safe
> addresses, e.g. 128 bytes on arm64. There, struct devres amounts to:
> 3 pointers + pad_to_128 + data + pad_to_256
> i.e. ~220 bytes of padding.
>
> Let's enforce the alignment only for devm_kmalloc().
>
> Suggested-by: Robin Murphy <robin.murphy@arm.com>
> Signed-off-by: Marc Gonzalez <marc.w.gonzalez@free.fr>
> ---
> I had not been aware that dynamic allocation granularity on arm64 was
> 128 bytes. This means there's a lot of waste on small allocations.
> I suppose there's no easy solution, though.
> ---
> drivers/base/devres.c | 23 +++++++++++++----------
> 1 file changed, 13 insertions(+), 10 deletions(-)

You need to get Alexey to agree with this, he's the one that hit this on
ARC :)

thanks,

greg k-h

\
 
 \ /
  Last update: 2019-12-17 16:46    [W:0.077 / U:10.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site