Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp850803pxb; Thu, 21 Apr 2022 11:44:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy33u6KFPSkWmXKrpqBoI1oS2kjOFXnjHmZLd9ujSgZKQu6KUbibmS1BIHuvtKWF9PfZlgl X-Received: by 2002:aa7:ce16:0:b0:41d:8e19:6dfb with SMTP id d22-20020aa7ce16000000b0041d8e196dfbmr1038344edv.12.1650566688246; Thu, 21 Apr 2022 11:44:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650566688; cv=none; d=google.com; s=arc-20160816; b=IGQNMTOdr7Dyl8Cg5ePwYRutfywNiljpCk+BzcoSx5I/8nAUnWW5bQqO68V+f4iyEl MZSR8J6m21DfymhnDBz60ugvE6un+HquLDWynkccQbmGB4Ioj8rbfnCjBpWlm8u6W7sy 8vgI2PacG7LwK6AwriE2T6TUYCUIFCsTPY44KUVhwrwlxq2Tp8c3SpTrUe38YTB2Ab65 +SSUmrfqYvNfM6lzRRi8coXUrU1hNxnz7DyTxkbA/2kMrI3YRFxtXf7uimjPNnaGk7Ch S0BXPuo/r+orJyjBxNPe3Vn19id2n2Dx6wWWr7SWCWwF1Kkw55nWWbaq8N4P1cus12j5 toIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=ZpXrB2sWuWe52zYhe/I8eb7aVXcFaces/Cez/05c9cE=; b=fWmGt/ueDBNsKxmDEElL3m4Kc9pMQ6fpt8DU2ZdtVRp1XN3eBptfNDpjNdh0H7bHMz vGBVEilWrXxvwZo4io+1G3lejJ4DIEDb/msI12CkSN64ym10C+KvLqLHxuPVYqgDPeLb gT2LXuFKw/2XiwIS1ARBfwWXiSRACzjVn4xCjMXEZC8EiUJrTYoTalXAUlNGeMeHtc7Z hUOTTRUmWnp4/adKMscYM6DABX5RAhaQv53IIy2+/MDkKw+5LnPSA9bzzcg0EdSuGlxh MBVoCKbaryGFOcc1JzuZsilpeQq9RgFRZ3/DS5vVfPjPrF8EAWFqeRrr9Z6LaXaibzqw 9iNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KGDjP4xy; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o11-20020a17090608cb00b006e894ed1a28si4480975eje.593.2022.04.21.11.44.23; Thu, 21 Apr 2022 11:44:48 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KGDjP4xy; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357287AbiDSSie (ORCPT + 99 others); Tue, 19 Apr 2022 14:38:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357578AbiDSShl (ORCPT ); Tue, 19 Apr 2022 14:37:41 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C7464EA28; Tue, 19 Apr 2022 11:29:40 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3811E61598; Tue, 19 Apr 2022 18:29:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 92EA2C385A5; Tue, 19 Apr 2022 18:29:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650392979; bh=P3K1tP6cpjTFzC+59oPXafdJm30VtMZbfwvyBn+l0nE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=KGDjP4xyx8qxb3jFDHz8SacfWd77hO7wBWOMnWzPRIf+36togREFgtvY+2GisJ5ua EHD0M8aZbVy49xB218L2eVROCktRHVlRDvSaLidilao+Y7wl7Xx0LYiLyJmIsL03a8 bfW9XhwszwFNoSqXz0JnBmWXMG8R7GlFmt6q1YIPhRWQEz7n4rc2ff5LPJp2cPtXxi xa07K/QiNPc9XT3RmJMMChldEU66W8w7gOIpgjivdwmaolnQBl7AxOI1yM09fKC4Aj f/FYgrjmGmOaSrNgobpe1cKny6M9qVvgfpDYRTw/gRU6hssP9eo9T4rMq5ZDQevZWI 0o4WyjwLZNeRQ== Received: by mail-ot1-f44.google.com with SMTP id w23-20020a056830111700b00603c6d1ce73so8591016otq.9; Tue, 19 Apr 2022 11:29:39 -0700 (PDT) X-Gm-Message-State: AOAM531U5wTZFEqw1TVcTgTASE88ztCsgEsa2eCEZVrz+95Xsj3B0K3z o63NrQwtHVl1MO2P0f0Z9+HK/skzfYQiAvZU99M= X-Received: by 2002:a05:6830:33eb:b0:5f8:d36d:3831 with SMTP id i11-20020a05683033eb00b005f8d36d3831mr6341951otu.265.1650392978707; Tue, 19 Apr 2022 11:29:38 -0700 (PDT) MIME-Version: 1.0 References: <20220414101314.1250667-1-mawupeng1@huawei.com> <20220414101314.1250667-8-mawupeng1@huawei.com> <672ff459-81bd-38ef-882d-e718992d295c@arm.com> In-Reply-To: <672ff459-81bd-38ef-882d-e718992d295c@arm.com> From: Ard Biesheuvel Date: Tue, 19 Apr 2022 20:29:27 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 7/9] mm: Calc the right pfn if page size is not 4K To: Anshuman Khandual , Andrew Morton Cc: Wupeng Ma , Catalin Marinas , Will Deacon , Jonathan Corbet , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , X86 ML , hpa@zyccr.com, Darren Hart , Andy Shevchenko , Mike Rapoport , "Paul E. McKenney" , Peter Zijlstra , Joerg Roedel , songmuchun@bytedance.com, macro@orcam.me.uk, Frederic Weisbecker , W_Armin@gmx.de, John Garry , Sean Christopherson , Thomas Bogendoerfer , chenhuacai@kernel.org, David Hildenbrand , gpiccoli@igalia.com, Mark Rutland , Kefeng Wang , Linux Doc Mailing List , Linux Kernel Mailing List , Linux ARM , linux-efi , linux-ia64@vger.kernel.org, platform-driver-x86@vger.kernel.org, Linux Memory Management List Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 Tue, 19 Apr 2022 at 13:13, Anshuman Khandual wrote: > > > > 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 Acked-by: Ard Biesheuvel Andrew, can you please take this one through the -mm tree? The rest of the series needs a bit more work, but is an obvious fix and there is no point in holding it up. Thanks, Ard.