linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Nick Kossifidis <mick@ics.forth.gr>
To: Christoph Hellwig <hch@infradead.org>,
	Vladimir Kondratiev <Vladimir.Kondratiev@mobileye.com>
Cc: Alexandre Ghiti <alex@ghiti.fr>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	Andrew Morton <akpm@linux-foundation.org>,
	"linux-riscv@lists.infradead.org"
	<linux-riscv@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>
Subject: Re: [PATCH v1] riscv: make ZONE_DMA32 optional
Date: Mon, 7 Oct 2024 14:39:00 +0300	[thread overview]
Message-ID: <21feac2d-24e9-43f4-8a1b-728d4af6c4c7@ics.forth.gr> (raw)
In-Reply-To: <ZwN-E279o4bUQG26@infradead.org>

On 10/7/24 09:22, Christoph Hellwig wrote:
> On Mon, Oct 07, 2024 at 06:17:14AM +0000, Vladimir Kondratiev wrote:
>>> Well, this doesn't get any more true by just irgnoring the previous
>>> discussion and just reposting :(
>>
>> Sorry, this wasn't the intention. Perhaps I messed with the message-id, I see my "patch v1" in one mail thread together with the previous discussion, but not in the other thread.
>>
>> Anyway, I think making ZONE_DMA32 selection depend on NONPORTABLE answers the concern
>> that was raised
> 
> It doesn't at all.
> 
> For one not having ZONE_DMA32 is going to break a lot of things.
> Drivers do expect 32-bit addressable memory.  And because SOC designers
> know this there usually is a way to provide it, e.g. by doing window
> translations between cpu physical and bus physical address.  Please go
> back to your data sheet or talk to the designers.
> 
> And if there really is not way to provide this, the right way is just
> to stop the runtime allocation that triggered you to do this if
> ZONE_DMA32 is empty, not to add a non-portable option.
> 

I agree with Christoph on this one, by the time dma_atomic_pool_init() 
gets called we already know the system's DRAM base for example and if we 
have 32bit addressable regions (or aliases / translation windows as 
Christoph mentioned) or not. We could use this info to skip ZONE_DMA32, 
or just use a command line argument like this RFC proposed:
https://lore.kernel.org/linux-arm-kernel/20230201040913.GA4959@hu-cgoldswo-sd.qualcomm.com/T/

There is no reason to configure this at compile time, and completely 
remove support for ZONE_DMA32. Also NONPORTABLE doesn't address Alex's 
point on distro kernels, since distro kernels won't set NONPORTABLE.

BTW I tried reproducing this with a recent 6.10 kernel and couldn't, our 
system also has DRAM way above 32bits and this is also on a modified 
QEMU machine, here is the full log:
https://pastebin.com/9HLcphgY

You can use this script to reproduce our QEMU setup if interested:
https://github.com/CARV-ICS-FORTH/yarvt/tree/eupilot

Regards,
Nick


  reply	other threads:[~2024-10-07 11:39 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-27 11:36 [PATCH] riscv: make ZONE_DMA32 optional Vladimir Kondratiev
2024-08-27 23:10 ` Drew Fustini
2024-09-20  8:58   ` Palmer Dabbelt
2024-09-20 13:18     ` Drew Fustini
2024-09-23  9:46       ` Ben Dooks
2024-09-20 14:04 ` Christoph Hellwig
2024-09-22 10:06   ` Vladimir Kondratiev
2024-09-24  6:39     ` Christoph Hellwig
2024-09-30  9:55 ` Alexandre Ghiti
2024-10-06 10:44   ` Vladimir Kondratiev
2024-10-06 10:55     ` [PATCH v1] " Vladimir Kondratiev
2024-10-06 22:58       ` Drew Fustini
2024-10-07  5:41       ` Christoph Hellwig
2024-10-07  6:17         ` Vladimir Kondratiev
2024-10-07  6:22           ` Christoph Hellwig
2024-10-07 11:39             ` Nick Kossifidis [this message]
2024-10-07 13:03             ` Vladimir Kondratiev
2024-10-07 12:17     ` [PATCH] " Ben Dooks

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=21feac2d-24e9-43f4-8a1b-728d4af6c4c7@ics.forth.gr \
    --to=mick@ics.forth.gr \
    --cc=Vladimir.Kondratiev@mobileye.com \
    --cc=akpm@linux-foundation.org \
    --cc=alex@ghiti.fr \
    --cc=aou@eecs.berkeley.edu \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    /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;
as well as URLs for NNTP newsgroup(s).