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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0632FC433F5 for ; Tue, 19 Apr 2022 11:13:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349288AbiDSLQZ (ORCPT ); Tue, 19 Apr 2022 07:16:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230010AbiDSLQV (ORCPT ); Tue, 19 Apr 2022 07:16:21 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5664C2B1B2; Tue, 19 Apr 2022 04:13:39 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id BB81B1042; Tue, 19 Apr 2022 04:13:38 -0700 (PDT) Received: from [10.163.40.223] (unknown [10.163.40.223]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B88BE3F73B; Tue, 19 Apr 2022 04:13:22 -0700 (PDT) Message-ID: <672ff459-81bd-38ef-882d-e718992d295c@arm.com> Date: Tue, 19 Apr 2022 16:44:06 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH v2 7/9] mm: Calc the right pfn if page size is not 4K Content-Language: en-US To: Wupeng Ma , akpm@linux-foundation.org, catalin.marinas@arm.com, will@kernel.org, corbet@lwn.net Cc: ardb@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zyccr.com, dvhart@infradead.org, andy@infradead.org, rppt@kernel.org, paulmck@kernel.org, peterz@infradead.org, jroedel@suse.de, songmuchun@bytedance.com, macro@orcam.me.uk, frederic@kernel.org, W_Armin@gmx.de, john.garry@huawei.com, seanjc@google.com, tsbogend@alpha.franken.de, chenhuacai@kernel.org, david@redhat.com, gpiccoli@igalia.com, mark.rutland@arm.com, wangkefeng.wang@huawei.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-efi@vger.kernel.org, linux-ia64@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-mm@kvack.org References: <20220414101314.1250667-1-mawupeng1@huawei.com> <20220414101314.1250667-8-mawupeng1@huawei.com> From: Anshuman Khandual In-Reply-To: <20220414101314.1250667-8-mawupeng1@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/14/22 15:43, Wupeng Ma wrote: > From: Ma Wupeng > > Previous 0x100000 is used to check the 4G limit in > find_zone_movable_pfns_for_nodes(). This is right in x86 because > the page size can only be 4K. But 16K and 64K are available in > arm64. So replace it with PHYS_PFN(SZ_4G). > > Signed-off-by: Ma Wupeng > --- > mm/page_alloc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index 6e5b4488a0c5..570d0ebf98df 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -7870,7 +7870,7 @@ static void __init find_zone_movable_pfns_for_nodes(void) > > usable_startpfn = memblock_region_memory_base_pfn(r); > > - if (usable_startpfn < 0x100000) { > + if (usable_startpfn < PHYS_PFN(SZ_4G)) { > mem_below_4gb_not_mirrored = true; > continue; > } Regardless PFN value should never be encoded directly. Reviewed-by: Anshuman Khandual 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 37F60C433F5 for ; Tue, 19 Apr 2022 11:14:44 +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:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=NS29GR2R7FCMo4x2DLCkeUtAHn8P0PtsD1fUUHn9nlw=; b=wFDb1nQMqRwFHh lmqb6SP5XXsgExmIgyQZph8JDqdI+hUTWLzCOo3ezwM08PLRkNMCL3mB3xb6XXbGWv1YcLZQZlGUx rCvl/3pgkQLJWAarF+NX+miSA694iQ+CVp+kfXPW8l8vK5Y8XDbDCd5XcJoMOrk/9Fp6QtCsn4Zht um2US2RxeQnVY8wAe0wTJFAIPZADWlejLXMLe5zbRWJNvhLzzPxRiSb46LQxBIo0K0I9srz/OD/3C lG8qQKp2i52xMTvtO6i7tG6WhvHcxV1eVUWnw/rFzIuzGKmg+P9fqEeghqY/jQyd51gqRvVGldnRE Cb3fOZ1VIIc1B6gbjMcA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nglnj-00310w-91; Tue, 19 Apr 2022 11:13:43 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nglng-0030zW-Pm for linux-arm-kernel@lists.infradead.org; Tue, 19 Apr 2022 11:13:42 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id BB81B1042; Tue, 19 Apr 2022 04:13:38 -0700 (PDT) Received: from [10.163.40.223] (unknown [10.163.40.223]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B88BE3F73B; Tue, 19 Apr 2022 04:13:22 -0700 (PDT) Message-ID: <672ff459-81bd-38ef-882d-e718992d295c@arm.com> Date: Tue, 19 Apr 2022 16:44:06 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH v2 7/9] mm: Calc the right pfn if page size is not 4K Content-Language: en-US To: Wupeng Ma , akpm@linux-foundation.org, catalin.marinas@arm.com, will@kernel.org, corbet@lwn.net Cc: ardb@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zyccr.com, dvhart@infradead.org, andy@infradead.org, rppt@kernel.org, paulmck@kernel.org, peterz@infradead.org, jroedel@suse.de, songmuchun@bytedance.com, macro@orcam.me.uk, frederic@kernel.org, W_Armin@gmx.de, john.garry@huawei.com, seanjc@google.com, tsbogend@alpha.franken.de, chenhuacai@kernel.org, david@redhat.com, gpiccoli@igalia.com, mark.rutland@arm.com, wangkefeng.wang@huawei.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-efi@vger.kernel.org, linux-ia64@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-mm@kvack.org References: <20220414101314.1250667-1-mawupeng1@huawei.com> <20220414101314.1250667-8-mawupeng1@huawei.com> From: Anshuman Khandual In-Reply-To: <20220414101314.1250667-8-mawupeng1@huawei.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220419_041340_929256_D7AE08AA X-CRM114-Status: GOOD ( 16.45 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 4/14/22 15:43, Wupeng Ma wrote: > From: Ma Wupeng > > Previous 0x100000 is used to check the 4G limit in > find_zone_movable_pfns_for_nodes(). This is right in x86 because > the page size can only be 4K. But 16K and 64K are available in > arm64. So replace it with PHYS_PFN(SZ_4G). > > Signed-off-by: Ma Wupeng > --- > mm/page_alloc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index 6e5b4488a0c5..570d0ebf98df 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -7870,7 +7870,7 @@ static void __init find_zone_movable_pfns_for_nodes(void) > > usable_startpfn = memblock_region_memory_base_pfn(r); > > - if (usable_startpfn < 0x100000) { > + if (usable_startpfn < PHYS_PFN(SZ_4G)) { > mem_below_4gb_not_mirrored = true; > continue; > } Regardless PFN value should never be encoded directly. Reviewed-by: Anshuman Khandual _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anshuman Khandual Date: Tue, 19 Apr 2022 11:26:06 +0000 Subject: Re: [PATCH v2 7/9] mm: Calc the right pfn if page size is not 4K Message-Id: <672ff459-81bd-38ef-882d-e718992d295c@arm.com> List-Id: References: <20220414101314.1250667-1-mawupeng1@huawei.com> <20220414101314.1250667-8-mawupeng1@huawei.com> In-Reply-To: <20220414101314.1250667-8-mawupeng1@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Wupeng Ma , akpm@linux-foundation.org, catalin.marinas@arm.com, will@kernel.org, corbet@lwn.net Cc: ardb@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zyccr.com, dvhart@infradead.org, andy@infradead.org, rppt@kernel.org, paulmck@kernel.org, peterz@infradead.org, jroedel@suse.de, songmuchun@bytedance.com, macro@orcam.me.uk, frederic@kernel.org, W_Armin@gmx.de, john.garry@huawei.com, seanjc@google.com, tsbogend@alpha.franken.de, chenhuacai@kernel.org, david@redhat.com, gpiccoli@igalia.com, mark.rutland@arm.com, wangkefeng.wang@huawei.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-efi@vger.kernel.org, linux-ia64@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-mm@kvack.org On 4/14/22 15:43, Wupeng Ma wrote: > From: Ma Wupeng > > Previous 0x100000 is used to check the 4G limit in > find_zone_movable_pfns_for_nodes(). This is right in x86 because > the page size can only be 4K. But 16K and 64K are available in > arm64. So replace it with PHYS_PFN(SZ_4G). > > Signed-off-by: Ma Wupeng > --- > mm/page_alloc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index 6e5b4488a0c5..570d0ebf98df 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -7870,7 +7870,7 @@ static void __init find_zone_movable_pfns_for_nodes(void) > > usable_startpfn = memblock_region_memory_base_pfn(r); > > - if (usable_startpfn < 0x100000) { > + if (usable_startpfn < PHYS_PFN(SZ_4G)) { > mem_below_4gb_not_mirrored = true; > continue; > } Regardless PFN value should never be encoded directly. Reviewed-by: Anshuman Khandual