MIPS: ralink: reduce ARCH_DMA_MINALIGN
PATCH 1/1 MIPS: ralink: reduce ARCH_DMA_MINALIGN
Currently, Ralink SoCs use the default ARCH_DMA_MINALIGN value of 128 bytes defined in mach-generic. This is excessive for these platforms and leads to significant memory waste in kmalloc.
Override ARCH_DMA_MINALIGN to use L1_CACHE_BYTES, which is 16 bytes for RT288X and 32 bytes for other Ralink SoCs.
Signed-off-by Qingfang Deng <[email protected]>
--- arch/mips/include/asm/mach-ralink/kmalloc.h | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 arch/mips/include/asm/mach-ralink/kmalloc.h
arch/mips/include/asm/mach-ralink/kmalloc.h new file +9 -0
@@ -0,0 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __ASM_MACH_RALINK_KMALLOC_H +#define __ASM_MACH_RALINK_KMALLOC_H + +#ifdef CONFIG_DMA_NONCOHERENT +#define ARCH_DMA_MINALIGN L1_CACHE_BYTES +#endif + +#endif /* __ASM_MACH_RALINK_KMALLOC_H */
Signature · 1 line
2.43.0
Quoted 4 lines · Qingfang Deng
Currently, Ralink SoCs use the default
ARCH_DMA_MINALIGNvalue of 128 bytes defined in mach-generic. This is excessive for these platforms and leads to significant memory waste in kmalloc.
Quoted 8 lines
Override
ARCH_DMA_MINALIGNto useL1_CACHE_BYTES, which is 16 bytes for RT288X and 32 bytes for other Ralink SoCs.Signed-off-by Qingfang Deng <[email protected]>--- arch/mips/include/asm/mach-ralink/kmalloc.h | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 arch/mips/include/asm/mach-ralink/kmalloc.h
applied to mips-next
Thomas.
Signature · 2 lines
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]