mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
To: Peng Fan <peng.fan@nxp.com>, Catalin Marinas <catalin.marinas@arm.com>
Cc: "will@kernel.org" <will@kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	dl-linux-imx <linux-imx@nxp.com>,
	Robin Murphy <robin.murphy@arm.com>
Subject: Re: [PATCH] arm64: mm: make CONFIG_ZONE_DMA configurable without EXPERT
Date: Fri, 27 Mar 2020 12:17:59 +0100	[thread overview]
Message-ID: <41607c9fc20afc6554d697daa7782de1e3281db7.camel@suse.de> (raw)
In-Reply-To: <AM0PR04MB4481C3A233AB455BDC68736288CE0@AM0PR04MB4481.eurprd04.prod.outlook.com>

[-- Attachment #1: Type: text/plain, Size: 2414 bytes --]

Hi Peng,

On Wed, 2020-03-25 at 12:30 +0000, Peng Fan wrote:
> > > > I see a few potential options:
> > > > 
> > > > a) Ensure the CMA is contained within a single zone.
> > > 
> > > This will break legacy dts with new version kernel.
> > > 
> > > > How large is it in your case?
> > > 
> > > It is 1GB
> > > 
> > > > Is it allocated by the kernel dynamically or a fixed start set by
> > > > the boot loader?
> > > 
> > > We use alloc-ranges and size in kernel dts.
> > > 
> > > But there is only 2GB DRAM in the board.
> > 
> > So I guess without changing the dts, option (a) doesn't really work.
> > 
> > > > b) Change the CMA allocator to allow spanning multiple zones (last time
> > > >    I looked it wasn't trivial since it relied on some per-zone lock).

I like this as a solution, ultimately why should CMA be linked to a specific
zone. Also, crossing the ZONE_DMA/ZONE_DMA32 boundary shouldn't be an issue
since we already default to ZONE_DMA32 as the default area for CMA.

That said, easier said than done.

> > > > c) Make ZONE_DMA dynamic on arm64 and only enable it if RPi4.
> > > 
> > > Option c seems a bit easier to me :)
> > > 
> > > I will try to explore both, but if you have time to help, that would
> > > be appreciated.
> > 
> > I don't have time but option (c) was already discussed and there are patches
> > from Nicolas on the list:
> > 
> > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore.ke
> > rnel.org%2Flinux-arm-kernel%2F20190820145821.27214-5-nsaenzjulienne%
> > 40suse.de%2F&amp;data=02%7C01%7Cpeng.fan%40nxp.com%7C6403ddf37
> > 89b452ae5ee08d7d0a5a659%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0
> > %7C0%7C637207282191026738&amp;sdata=t2cZ9HTCcRuaL9RO4kD%2BzN
> > 2n4VqM%2F66zYNZIOComCVs%3D&amp;reserved=0
> > 
> > The above series was checking whether the platform is RPi4 and limiting the
> > ZONE_DMA size to 1GB (otherwise 4GB with ZONE_DMA32 empty). We
> > ended up with a static 1GB for ZONE_DMA but we missed the fact that it may
> > break existing platforms.
> 
> Thanks for the information. I'll check the patchset and work out something
> proper to fix the issue I met.

Just an FYI, I'm follwing the conversation, and will try to look into as soon
as I get some free time. In the meantime if you want me to test/review anything
on the Raspberry Pi, I'll be happy to.

Regards,
Nicolas


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

      reply	other threads:[~2020-03-27 11:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-10 12:48 peng.fan
2020-03-23  1:30 ` Peng Fan
2020-03-24 17:41 ` Catalin Marinas
2020-03-25  0:34   ` Peng Fan
2020-03-25 10:16     ` Catalin Marinas
2020-03-25 12:30       ` Peng Fan
2020-03-27 11:17         ` Nicolas Saenz Julienne [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=41607c9fc20afc6554d697daa7782de1e3281db7.camel@suse.de \
    --to=nsaenzjulienne@suse.de \
    --cc=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peng.fan@nxp.com \
    --cc=robin.murphy@arm.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®