From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Return-Path: Date: Mon, 13 Feb 2017 11:36:24 +0000 From: Will Deacon To: Geert Uytterhoeven Cc: Marek Szyprowski , Catalin Marinas , Arnd Bergmann , Robin Murphy , Magnus Damm , linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH/RESEND] arm64: defconfig: Enlarge CMA alignment to 2 MiB Message-ID: <20170213113624.GI1512@arm.com> References: <1486983858-11362-1-git-send-email-geert+renesas@glider.be> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1486983858-11362-1-git-send-email-geert+renesas@glider.be> Sender: linux-kernel-owner@vger.kernel.org List-ID: 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 > --- > 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: will.deacon@arm.com (Will Deacon) Date: Mon, 13 Feb 2017 11:36:24 +0000 Subject: [PATCH/RESEND] arm64: defconfig: Enlarge CMA alignment to 2 MiB In-Reply-To: <1486983858-11362-1-git-send-email-geert+renesas@glider.be> References: <1486983858-11362-1-git-send-email-geert+renesas@glider.be> Message-ID: <20170213113624.GI1512@arm.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org 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 > --- > 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