From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F1582CD582A for ; Wed, 7 Jan 2026 10:20:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=HlhBE9+DppXmppj5Sx6NwqxaWZLAGslePdZlkisL2JU=; b=tYJAA7rkvJ/YNt NCGJQ1a3WDQ+HHQYLasnMhgZeNsbZ4mqllBD4pif6Tbtb+86M1GHV+Ao6lsFF6nTDtSOyHfAjQJxM 6KnPN68khxqr4cj6RnK/bqq3KgKsXaWQ+To6aUf4wNAHebxoj1SNMp0Y45V9Sh+j6SeDaNQiWz6N/ bRNavVl4qIMbPrOCjJh13xCy55GhYgUy0eLRkbqmOFHo89/cCbdsPqjepajR9As/lpYqojq6xQa8m l+kchTO/sDLgeobMI4xdA0YegGmualFD4EZ+RBdMsQi/OWwHEWPgELYZvrAk9pvtGsLfzzsDj/wFg 4e7ECcxPKO5HOgSuMgsQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vdQel-0000000Egwh-1U5w; Wed, 07 Jan 2026 10:20:47 +0000 Received: from tor.source.kernel.org ([172.105.4.254]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vdQej-0000000Egvw-26d3; Wed, 07 Jan 2026 10:20:45 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 3697D60007; Wed, 7 Jan 2026 10:20:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 332F3C4CEF7; Wed, 7 Jan 2026 10:20:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1767781243; bh=2N7QgaN9sMjltiFqaQG4UkyiWR5RDDQ2n4IgHLPouW4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HG3UgZmir72YPYFm/emlV/3aORPdbjLAnBvpX04p5XtFP762LStn/wPAzNuqOQyK8 k7OnYBM5tMSwl6jbeHb8PLi19AGtC/53sTnfGuvHRwU1J5fTUCYLII+PuhChCRsuuP lesNvqozgo8UJHTVTNpJsDervk1O2VsPtftbzvVYNlT5k9C+Ou7zoWZDNLa9w7OL7l 1I+dvThsPPRQrJPx2bNt/P7eQY786Hlh4y2DUZqzVomuI/Tc2vep7bqbTNymx1RDAb W1AWrPHPHnhn5oDQwiHOAOhH7g90DnMJIt+6Fqkfre323p/NzMyoEh/2zKKa/f4rTg 6GL2C2ybj5rcA== Date: Wed, 7 Jan 2026 12:20:23 +0200 From: Mike Rapoport To: Ritesh Harjani Cc: Andrew Morton , Alex Shi , Alexander Gordeev , Andreas Larsson , Borislav Petkov , Brian Cain , "Christophe Leroy (CS GROUP)" , Catalin Marinas , "David S. Miller" , Dave Hansen , David Hildenbrand , Dinh Nguyen , Geert Uytterhoeven , Guo Ren , Heiko Carstens , Helge Deller , Huacai Chen , Ingo Molnar , Johannes Berg , John Paul Adrian Glaubitz , Jonathan Corbet , "Liam R. Howlett" , Lorenzo Stoakes , Magnus Lindholm , Matt Turner , Max Filippov , Michael Ellerman , Michal Hocko , Michal Simek , Muchun Song , Oscar Salvador , Palmer Dabbelt , Pratyush Yadav , Richard Weinberger , Russell King , Stafford Horne , Suren Baghdasaryan , Thomas Bogendoerfer , Thomas Gleixner , Vasily Gorbik , Vineet Gupta , Vlastimil Babka , Will Deacon , x86@kernel.org, linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org, linux-cxl@vger.kernel.org, linux-doc@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-openrisc@vger.kernel.org, linux-parisc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-um@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, sparclinux@vger.kernel.org Subject: Re: [PATCH v2 14/28] powerpc: introduce arch_zone_limits_init() Message-ID: References: <20260102070005.65328-1-rppt@kernel.org> <20260102070005.65328-15-rppt@kernel.org> <87ldia9he1.ritesh.list@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87ldia9he1.ritesh.list@gmail.com> X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Hi, On Wed, Jan 07, 2026 at 09:57:34AM +0530, Ritesh Harjani wrote: > Mike Rapoport writes: > > > From: "Mike Rapoport (Microsoft)" > > > > Move calculations of zone limits to a dedicated arch_zone_limits_init() > > function. > > > > Later MM core will use this function as an architecture specific callback > > during nodes and zones initialization and thus there won't be a need to > > call free_area_init() from every architecture. > > > > Signed-off-by: Mike Rapoport (Microsoft) > > --- > > arch/powerpc/mm/mem.c | 22 ++++++++++++---------- > > 1 file changed, 12 insertions(+), 10 deletions(-) > > > > diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c > > index 3ddbfdbfa941..32c496bfab4f 100644 > > --- a/arch/powerpc/mm/mem.c > > +++ b/arch/powerpc/mm/mem.c > > @@ -221,13 +221,23 @@ static int __init mark_nonram_nosave(void) > > * anyway) will take a first dip into ZONE_NORMAL and get otherwise served by > > * ZONE_DMA. > > */ > > -static unsigned long max_zone_pfns[MAX_NR_ZONES]; > > +void __init arch_zone_limits_init(unsigned long *max_zone_pfns) > > +{ > > +#ifdef CONFIG_ZONE_DMA > > + max_zone_pfns[ZONE_DMA] = min(zone_dma_limit, max_low_pfn - 1) + 1; > > Hi Mike, > > This doesn't look correct. Isn't the zone_dma_limit value in bytes actually? > Shouldn't it be - > > max_zone_pfns[ZONE_DMA] = min((zone_dma_limit >> PAGE_SHIFT) + 1, max_low_pfn); You are right, I'll update it for v3. > -ritesh -- Sincerely yours, Mike. _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv