Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp4536926pxb; Wed, 20 Apr 2022 05:23:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMEWcHGf1fiw1dnu3u75oqHlAI1S07egxfuQcMNeItLYBtlP8rVnOuYZ0GWxK2q5/T77nP X-Received: by 2002:a17:902:c752:b0:158:474b:d557 with SMTP id q18-20020a170902c75200b00158474bd557mr19873882plq.165.1650457406240; Wed, 20 Apr 2022 05:23:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650457406; cv=none; d=google.com; s=arc-20160816; b=Pmkb/qBWUtM6tSFsJT8rQC1aY+X3p1LSzp9DRZYtMPPQCEtvKyImZgMH23vDh86MtA jK9OVucTOkKSF2kGp8M3wo7RrI115IwXAWKDNkjKvmATn+iCdJwN/MmJ7Du4rdUXIwm/ 5A90qIPAsv0Cc4GYO04JKODH+cdzOC5gXzfiKygI+LD+OUnMfBBMGdO2GQ/ZHqBnusyX ThQiMCdDYmTp8xbGSb/atV9FbonjaSnrGTr85rcfUD1DIcy4HU6ZDFSEHXQI8AXlgcLE gg9qh02Hb7rYexNm/5G9T+HN3zbqWW6s5S6lqzUbkjgWOFPCUXtKBJQqI1L/SV256GuD x3aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=qE/xLrBT9vRCDb8zY+XKYzGWMoVCpK0Qfu+9uM7BhiY=; b=h/cyB6acCJz+lKX/LStiWMG3lDUMQf3TYBGSCycv3lxneLAmxDqJT3A8LP/s+ajTTx I1Iez1EGbfgLS0UqV7gegb0S4cA4Teuk+LSxzIdYwifAcpYMRXwS5Yda23UZ7mea4CgX ZaBC7rrybMJVdIIOS2YiVQnQODiJWAg0lp8TzBHDlHgX9Kvsyk9XUKTEEemIxRmEW4wA ATOyvE5cLhMSy500wjIYHRBGEc1v8Kru97SYN13JKjuF1HWbotZ/GIO2chrVIfhshs/w n8sYbyVDHXYNvLTxO47BJcDWsNqNm8t/FbHahlnsEh40PeOI8b6N1mNkbGuZxnFCpP9P QEXg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m12-20020a170902d18c00b00158b6f04ad1si1849476plb.192.2022.04.20.05.23.11; Wed, 20 Apr 2022 05:23:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349265AbiDSLQX (ORCPT + 99 others); Tue, 19 Apr 2022 07:16:23 -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 X-Spam-Status: No, score=-10.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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