Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1571576 > unrolled thread

Re: [PATCH/RFC] arm64: defconfig: Enlarge CMA alignment to 2 MiB

Started byMagnus Damm <magnus.damm@gmail.com>
First post2017-02-01 14:50 +0100
Last post2017-02-13 11:30 +0100
Articles 5 — 4 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH/RFC] arm64: defconfig: Enlarge CMA alignment to 2 MiB Magnus Damm <magnus.damm@gmail.com> - 2017-02-01 14:50 +0100
    Re: [PATCH/RFC] arm64: defconfig: Enlarge CMA alignment to 2 MiB Robin Murphy <robin.murphy@arm.com> - 2017-02-01 15:10 +0100
      Re: [PATCH/RFC] arm64: defconfig: Enlarge CMA alignment to 2 MiB Simon Horman <horms@verge.net.au> - 2017-02-02 10:30 +0100
      Re: [PATCH/RFC] arm64: defconfig: Enlarge CMA alignment to 2 MiB Geert Uytterhoeven <geert@linux-m68k.org> - 2017-02-13 11:40 +0100
    Re: [PATCH/RFC] arm64: defconfig: Enlarge CMA alignment to 2 MiB Geert Uytterhoeven <geert@linux-m68k.org> - 2017-02-13 11:30 +0100

#1571576 — Re: [PATCH/RFC] arm64: defconfig: Enlarge CMA alignment to 2 MiB

FromMagnus Damm <magnus.damm@gmail.com>
Date2017-02-01 14:50 +0100
SubjectRe: [PATCH/RFC] arm64: defconfig: Enlarge CMA alignment to 2 MiB
Message-ID<t63sm-6Bo-19@gated-at.bofh.it>
Hi Geert,

On Sat, Jan 28, 2017 at 1:03 AM, Geert Uytterhoeven
<geert+renesas@glider.be> 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?
>
> Should there instead be different defaults in Kconfig, depending on
> enabled platform support?

I think there is a dependency on the kernel page size configuration as
well. In case of 16 KiB or 64 KiB page size configuration other large
page sizes may be required.

Thanks,

/ magnus

[toc] | [next] | [standalone]


#1571583

FromRobin Murphy <robin.murphy@arm.com>
Date2017-02-01 15:10 +0100
Message-ID<t63LI-6WZ-19@gated-at.bofh.it>
In reply to#1571576
On 01/02/17 13:45, Magnus Damm wrote:
> Hi Geert,
> 
> On Sat, Jan 28, 2017 at 1:03 AM, Geert Uytterhoeven
> <geert+renesas@glider.be> 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?
>>
>> Should there instead be different defaults in Kconfig, depending on
>> enabled platform support?
> 
> I think there is a dependency on the kernel page size configuration as
> well. In case of 16 KiB or 64 KiB page size configuration other large
> page sizes may be required.

I don't see the original patch (linux-arm-kernel doesn't look to have it
archived either), but I think bumping the default up to 2MB to match our
normal section size sounds generally reasonable - users can still
override it manually in their config, right? For 16KB and 64KB granules,
it is at least the size covered by contiguous-hinted pages; the actual
section sizes there are far too big to be practical for alignment
purposes anyway (32MB and 512MB respectively).

Robin.

> 
> Thanks,
> 
> / magnus
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 

[toc] | [prev] | [next] | [standalone]


#1572217

FromSimon Horman <horms@verge.net.au>
Date2017-02-02 10:30 +0100
Message-ID<t6lSj-1ZO-27@gated-at.bofh.it>
In reply to#1571583
On Wed, Feb 01, 2017 at 02:06:45PM +0000, Robin Murphy wrote:
> On 01/02/17 13:45, Magnus Damm wrote:
> > Hi Geert,
> > 
> > On Sat, Jan 28, 2017 at 1:03 AM, Geert Uytterhoeven
> > <geert+renesas@glider.be> 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?
> >>
> >> Should there instead be different defaults in Kconfig, depending on
> >> enabled platform support?
> > 
> > I think there is a dependency on the kernel page size configuration as
> > well. In case of 16 KiB or 64 KiB page size configuration other large
> > page sizes may be required.
> 
> I don't see the original patch (linux-arm-kernel doesn't look to have it
> archived either), but I think bumping the default up to 2MB to match our
> normal section size sounds generally reasonable - users can still
> override it manually in their config, right? For 16KB and 64KB granules,
> it is at least the size covered by contiguous-hinted pages; the actual
> section sizes there are far too big to be practical for alignment
> purposes anyway (32MB and 512MB respectively).

I am happy to take this patch on the strength of the above but an Ack or
similar tag from Robin would be nice. Geert, perhaps you could repost the
patch with Robin CCed?

[toc] | [prev] | [next] | [standalone]


#1579592

FromGeert Uytterhoeven <geert@linux-m68k.org>
Date2017-02-13 11:40 +0100
Message-ID<tamd4-2uM-27@gated-at.bofh.it>
In reply to#1571583
Hi Robin,

On Wed, Feb 1, 2017 at 3:06 PM, Robin Murphy <robin.murphy@arm.com> wrote:
> On 01/02/17 13:45, Magnus Damm wrote:
>> On Sat, Jan 28, 2017 at 1:03 AM, Geert Uytterhoeven
>> <geert+renesas@glider.be> 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?
>>>
>>> Should there instead be different defaults in Kconfig, depending on
>>> enabled platform support?
>>
>> I think there is a dependency on the kernel page size configuration as
>> well. In case of 16 KiB or 64 KiB page size configuration other large
>> page sizes may be required.
>
> I don't see the original patch (linux-arm-kernel doesn't look to have it
> archived either), but I think bumping the default up to 2MB to match our

These days linux-arm-kernel (infradead) tends to reject my patches :-(

linux-renesas-soc patchwork does have it:
https://patchwork.kernel.org/patch/9542173/

> normal section size sounds generally reasonable - users can still
> override it manually in their config, right? For 16KB and 64KB granules,
> it is at least the size covered by contiguous-hinted pages; the actual
> section sizes there are far too big to be practical for alignment
> purposes anyway (32MB and 512MB respectively).

Yes, it can be overridden by the user.

One slight annoyance is the dependency on PAGE_SHIFT: if you increase
ARM64_PAGE_SHIFT, you want to decrease CONFIG_CMA_ALIGNMENT.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

[toc] | [prev] | [next] | [standalone]


#1579580

FromGeert Uytterhoeven <geert@linux-m68k.org>
Date2017-02-13 11:30 +0100
Message-ID<tam3n-2qv-3@gated-at.bofh.it>
In reply to#1571576
Hi Magnus,

On Wed, Feb 1, 2017 at 2:45 PM, Magnus Damm <magnus.damm@gmail.com> wrote:
> On Sat, Jan 28, 2017 at 1:03 AM, Geert Uytterhoeven
> <geert+renesas@glider.be> 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?
>>
>> Should there instead be different defaults in Kconfig, depending on
>> enabled platform support?
>
> I think there is a dependency on the kernel page size configuration as
> well. In case of 16 KiB or 64 KiB page size configuration other large
> page sizes may be required.

This is about IOMMU pages, not (CPU)MMU pages?

Still, there is indeed some dependency, as CONFIG_CMA_ALIGNMENT is a
shift relative to PAGE_SHIFT (i.e. CONFIG_ARM64_PAGE_SHIFT = 12 in
arm64_defconfig).

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web