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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7502EC433EF for ; Wed, 20 Apr 2022 22:39:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 095996B0071; Wed, 20 Apr 2022 18:39:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0469B6B0073; Wed, 20 Apr 2022 18:39:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E50E56B0074; Wed, 20 Apr 2022 18:39:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.25]) by kanga.kvack.org (Postfix) with ESMTP id D83E26B0071 for ; Wed, 20 Apr 2022 18:39:58 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id A155E61276 for ; Wed, 20 Apr 2022 22:39:58 +0000 (UTC) X-FDA: 79378726476.14.09A4AFF Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf09.hostedemail.com (Postfix) with ESMTP id B8E7F14001D for ; Wed, 20 Apr 2022 22:39:56 +0000 (UTC) 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 ams.source.kernel.org (Postfix) with ESMTPS id 34D35B81104 for ; Wed, 20 Apr 2022 22:39:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F11CBC385A0 for ; Wed, 20 Apr 2022 22:39:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650494395; bh=aOWblUPe/xTg2PyxTWlH8msgIf3I/JIiGnioyKq1k9o=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=O/cot0prbP1xGtzmpkijyTFPIlB3/piZOwbP31E51koXv4wql6y3s1y+RpsZg6bmY X0CLeCn2KJUBhl1JQrIfa4agmhu7Pf4kkuUqQCKH1rU+6ySd5NMx0Tvb0jJZQxflqQ GwZbsJo9eWff5XgHvnXQQXkOdPKNEqoeRuf/OMPc1Emse0yclV8vtQallAkRwB1Ma7 Xjj9S7Hbgq4dp6I71R7MK154rcUOFHidcy2fK91xkMFMNUb/vCKg9hXnHSjtBrajZx PtZdlKIKocRVnB7NjPjgeKrUSfO4ytsQGZC5la47hj6o9bE7NYwa4PLlO4s33bh0rK mj7COTAZeFsPg== Received: by mail-oi1-f169.google.com with SMTP id 12so3695011oix.12 for ; Wed, 20 Apr 2022 15:39:54 -0700 (PDT) X-Gm-Message-State: AOAM530YzvBubyfyC0iswVFsGXQCz+atCOAB33UuhJpolMRJwSxksnHR I5LSQZ5X5nL4VwgMEgFTA2ymi0gPcvUtFpTs2o8= X-Google-Smtp-Source: ABdhPJxZceLkzkgqQi9EwcZrYEUaymGtXEIUQiolsWwk3vI0ao36aw7Bq1YFbzNnKRMN7QZZzGSJVrbK043bNAiuq5Y= X-Received: by 2002:a05:6808:e8d:b0:322:bac0:2943 with SMTP id k13-20020a0568080e8d00b00322bac02943mr2876683oil.126.1650494383711; Wed, 20 Apr 2022 15:39:43 -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> <20220420152749.d41097e7d53ccd6a2a2aea5f@linux-foundation.org> In-Reply-To: <20220420152749.d41097e7d53ccd6a2a2aea5f@linux-foundation.org> From: Ard Biesheuvel Date: Thu, 21 Apr 2022 00:39:32 +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: Andrew Morton Cc: Anshuman Khandual , 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-Rspam-User: X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: B8E7F14001D X-Stat-Signature: 39sw9u3n4tb7w1p883dnhmnktaqbjy59 Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="O/cot0pr"; spf=pass (imf09.hostedemail.com: domain of ardb@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=ardb@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-HE-Tag: 1650494396-344805 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, 21 Apr 2022 at 00:27, Andrew Morton wrote: > > On Tue, 19 Apr 2022 20:29:27 +0200 Ard Biesheuvel wrote: > > > > > --- 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. > > Sure. > > I'm not seeing any description of the runtime effects of this > shortcoming. I tentatively queued the fix for 5.18, without a > cc:stable for backporting. But that might not be the best decision? > As far as I can tell, mirrored memory is only used on x86 today, where pages are always 4k. However, the whole notion of memory below 4 GB being special is a x86-ism, and so this logic does not appear to extrapolate to other architectures anyway, and probably needs more work. So definitely not a backportable fix, but just an incremental improvement, so either 5.18 or 5.19 should be fine afaict (and no cc:stable)