* [PATCH/RESEND] arm64: defconfig: Enlarge CMA alignment to 2 MiB
@ 2017-02-13 11:04 ` Geert Uytterhoeven
0 siblings, 0 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2017-02-13 11:04 UTC (permalink / raw)
To: Marek Szyprowski, Catalin Marinas, Will Deacon, Arnd Bergmann,
Robin Murphy
Cc: Magnus Damm, linux-arm-kernel, linux-renesas-soc, linux-kernel,
Geert Uytterhoeven
Some IOMMUs (e.g. Renesas IPMMU/VMSA) support only page sizes of 4 KiB,
2 MiB, and 1 GiB.
With the default setting of CONFIG_CMA_ALIGNMENT = 8, allocations larger
than 1 MiB are aligned to a 1 MiB boundary only. Hence a 2 MiB
allocation may not be aligned, leading to a mapping of 512 4 KiB pages.
Increase CONFIG_CMA_ALIGNMENT to allow mapping a 2 MiB buffer using a
single PTE, decreasing memory usage and TLB pressure.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
Is this useful?
Should there instead be different defaults in Kconfig, depending on
enabled platform support?
---
arch/arm64/configs/defconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
index 7735cfba01c8e650..7af449f3f41435bc 100644
--- a/arch/arm64/configs/defconfig
+++ b/arch/arm64/configs/defconfig
@@ -144,6 +144,7 @@ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
CONFIG_DMA_CMA=y
+CONFIG_CMA_ALIGNMENT=9
CONFIG_MTD=y
CONFIG_MTD_BLOCK=y
CONFIG_MTD_M25P80=y
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH/RESEND] arm64: defconfig: Enlarge CMA alignment to 2 MiB
@ 2017-02-13 11:04 ` Geert Uytterhoeven
0 siblings, 0 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2017-02-13 11:04 UTC (permalink / raw)
To: linux-arm-kernel
Some IOMMUs (e.g. Renesas IPMMU/VMSA) support only page sizes of 4 KiB,
2 MiB, and 1 GiB.
With the default setting of CONFIG_CMA_ALIGNMENT = 8, allocations larger
than 1 MiB are aligned to a 1 MiB boundary only. Hence a 2 MiB
allocation may not be aligned, leading to a mapping of 512 4 KiB pages.
Increase CONFIG_CMA_ALIGNMENT to allow mapping a 2 MiB buffer using a
single PTE, decreasing memory usage and TLB pressure.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
Is this useful?
Should there instead be different defaults in Kconfig, depending on
enabled platform support?
---
arch/arm64/configs/defconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
index 7735cfba01c8e650..7af449f3f41435bc 100644
--- a/arch/arm64/configs/defconfig
+++ b/arch/arm64/configs/defconfig
@@ -144,6 +144,7 @@ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
CONFIG_DMA_CMA=y
+CONFIG_CMA_ALIGNMENT=9
CONFIG_MTD=y
CONFIG_MTD_BLOCK=y
CONFIG_MTD_M25P80=y
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH/RESEND] arm64: defconfig: Enlarge CMA alignment to 2 MiB
2017-02-13 11:04 ` Geert Uytterhoeven
@ 2017-02-13 11:36 ` Will Deacon
-1 siblings, 0 replies; 4+ messages in thread
From: Will Deacon @ 2017-02-13 11:36 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Marek Szyprowski, Catalin Marinas, Arnd Bergmann, Robin Murphy,
Magnus Damm, linux-arm-kernel, linux-renesas-soc, linux-kernel
On Mon, Feb 13, 2017 at 12:04:18PM +0100, Geert Uytterhoeven wrote:
> Some IOMMUs (e.g. Renesas IPMMU/VMSA) support only page sizes of 4 KiB,
> 2 MiB, and 1 GiB.
>
> With the default setting of CONFIG_CMA_ALIGNMENT = 8, allocations larger
> than 1 MiB are aligned to a 1 MiB boundary only. Hence a 2 MiB
> allocation may not be aligned, leading to a mapping of 512 4 KiB pages.
>
> Increase CONFIG_CMA_ALIGNMENT to allow mapping a 2 MiB buffer using a
> single PTE, decreasing memory usage and TLB pressure.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> Is this useful?
I assume you're proposing it because you see an improvement? :)
> Should there instead be different defaults in Kconfig, depending on
> enabled platform support?
I don't object to updating defconfig as a quick hack, but the right solution
is probably to make the core Kconfig default value overridable by the
architecture.
Will
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH/RESEND] arm64: defconfig: Enlarge CMA alignment to 2 MiB
@ 2017-02-13 11:36 ` Will Deacon
0 siblings, 0 replies; 4+ messages in thread
From: Will Deacon @ 2017-02-13 11:36 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Feb 13, 2017 at 12:04:18PM +0100, Geert Uytterhoeven wrote:
> Some IOMMUs (e.g. Renesas IPMMU/VMSA) support only page sizes of 4 KiB,
> 2 MiB, and 1 GiB.
>
> With the default setting of CONFIG_CMA_ALIGNMENT = 8, allocations larger
> than 1 MiB are aligned to a 1 MiB boundary only. Hence a 2 MiB
> allocation may not be aligned, leading to a mapping of 512 4 KiB pages.
>
> Increase CONFIG_CMA_ALIGNMENT to allow mapping a 2 MiB buffer using a
> single PTE, decreasing memory usage and TLB pressure.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> Is this useful?
I assume you're proposing it because you see an improvement? :)
> Should there instead be different defaults in Kconfig, depending on
> enabled platform support?
I don't object to updating defconfig as a quick hack, but the right solution
is probably to make the core Kconfig default value overridable by the
architecture.
Will
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-02-13 12:39 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-13 11:04 [PATCH/RESEND] arm64: defconfig: Enlarge CMA alignment to 2 MiB Geert Uytterhoeven
2017-02-13 11:04 ` Geert Uytterhoeven
2017-02-13 11:36 ` Will Deacon
2017-02-13 11:36 ` Will Deacon
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.