[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191031155145.GF39590@arrakis.emea.arm.com>
Date: Thu, 31 Oct 2019 15:51:45 +0000
From: Catalin Marinas <catalin.marinas@....com>
To: Nicolas Saenz Julienne <nsaenzjulienne@...e.de>
Cc: Qian Cai <cai@....pw>, f.fainelli@...il.com, mbrugger@...e.com,
marc.zyngier@....com,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-mm@...ck.org, Rob Herring <robh+dt@...nel.org>,
linux-rpi-kernel@...ts.infradead.org, m.szyprowski@...sung.com,
Robin Murphy <Robin.Murphy@....com>, phill@...pberrypi.org,
will@...nel.org, Christoph Hellwig <hch@....de>,
linux-arm-kernel@...ts.infradead.org, wahrenst@....net
Subject: Re: [PATCH v6 3/4] arm64: use both ZONE_DMA and ZONE_DMA32
(sorry, I've been away last week and only now caught up with emails)
On Tue, Oct 22, 2019 at 01:23:32PM +0200, Nicolas Saenz Julienne wrote:
> On Mon, 2019-10-21 at 16:36 -0400, Qian Cai wrote:
> > I managed to get more information here,
> >
> > [ 0.000000] cma: dma_contiguous_reserve(limit c0000000)
> > [ 0.000000] cma: dma_contiguous_reserve: reserving 64 MiB for global area
> > [ 0.000000] cma: cma_declare_contiguous(size 0x0000000004000000, base
> > 0x0000000000000000, limit 0x00000000c0000000 alignment 0x0000000000000000)
> > [ 0.000000] cma: Failed to reserve 512 MiB
> >
> > Full dmesg:
> >
> > https://cailca.github.io/files/dmesg.txt
>
> OK I got it, reproduced it too.
>
> Here are the relevant logs:
>
> [ 0.000000] DMA [mem 0x00000000802f0000-0x00000000bfffffff]
> [ 0.000000] DMA32 [mem 0x00000000c0000000-0x00000000ffffffff]
> [ 0.000000] Normal [mem 0x0000000100000000-0x00000097fcffffff]
>
> As you can see ZONE_DMA spans from 0x00000000802f0000-0x00000000bfffffff which
> is slightly smaller than 1GB.
>
> [ 0.000000] crashkernel reserved: 0x000000009fe00000 - 0x00000000bfe00000 (512 MB)
>
> Here crashkernel reserved 512M in ZONE_DMA.
>
> [ 0.000000] cma: Failed to reserve 512 MiB
>
> CMA tried to allocate 512M in ZONE_DMA which fails as there is no enough space.
> Makes sense.
>
> A fix could be moving crashkernel reservations after CMA and then if unable to
> fit in ZONE_DMA try ZONE_DMA32 before bailing out. Maybe it's a little over the
> top, yet although most devices will be fine with ZONE_DMA32, the RPi4 needs
> crashkernel to be reserved in ZONE_DMA.
Does RPi4 need CMA in ZONE_DMA? If not, I'd rather reserve the CMA from
ZONE_DMA32.
Even if you moved the crash kernel, someone else might complain that
they had 2GB of CMA and it no longer works.
--
Catalin
Powered by blists - more mailing lists