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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A7A69C433F5 for ; Tue, 28 Sep 2021 06:12:29 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2D7AC61058 for ; Tue, 28 Sep 2021 06:12:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2D7AC61058 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=quicinc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 793E8900003; Tue, 28 Sep 2021 02:12:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7446A900002; Tue, 28 Sep 2021 02:12:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 615F3900003; Tue, 28 Sep 2021 02:12:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0161.hostedemail.com [216.40.44.161]) by kanga.kvack.org (Postfix) with ESMTP id 4F735900002 for ; Tue, 28 Sep 2021 02:12:28 -0400 (EDT) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id F342331E70 for ; Tue, 28 Sep 2021 06:12:27 +0000 (UTC) X-FDA: 78635962734.15.BF28D87 Received: from alexa-out.qualcomm.com (alexa-out.qualcomm.com [129.46.98.28]) by imf01.hostedemail.com (Postfix) with ESMTP id 63072506AB11 for ; Tue, 28 Sep 2021 06:12:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1632809547; x=1664345547; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=gs3m7sok0bsohq67jQzde48+nSgu0gFPpPY8ZHI02gg=; b=XhXxzxiXA7QKqS84kA/XYiN5QcZlwc4kWKboxcn3zzvJjo1PWLaGIIsE yep/jdP5J9dUaInJmpPO0HQUf2Vfq+5GbzusopkdYWN47xsBbgtcq1T1c wTy8VYVnORVVq9Wkg8SqzNzSgCz1wrjqJz4KlX7tCOUrH5eJZO8BKuzLU g=; Received: from ironmsg07-lv.qualcomm.com ([10.47.202.151]) by alexa-out.qualcomm.com with ESMTP; 27 Sep 2021 23:12:26 -0700 X-QCInternal: smtphost Received: from nalasex01a.na.qualcomm.com ([10.47.209.196]) by ironmsg07-lv.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Sep 2021 23:12:25 -0700 Received: from hu-cgoldswo-sd.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.922.7; Mon, 27 Sep 2021 23:12:24 -0700 Date: Mon, 27 Sep 2021 23:12:23 -0700 From: Chris Goldsworthy To: Georgi Djakov CC: David Hildenbrand , Chris Goldsworthy , Catalin Marinas , "Will Deacon" , Andrew Morton , , , , Sudarshan Rajagopalan Subject: Re: [RFC] arm64: mm: update max_pfn after memory hotplug Message-ID: <20210928061016.GA28837@hu-cgoldswo-sd.qualcomm.com> References: <595d09279824faf1f54961cef52b745609b05d97.1632437225.git.quic_cgoldswo@quicinc.com> <833493d2-d585-47ee-c258-79eae5deff36@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 63072506AB11 X-Stat-Signature: xqek3f7ym11jmhe77p5qqffx5dsafann Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=quicinc.com header.s=qcdkim header.b=XhXxzxiX; dmarc=pass (policy=none) header.from=quicinc.com; spf=pass (imf01.hostedemail.com: domain of quic_cgoldswo@quicinc.com designates 129.46.98.28 as permitted sender) smtp.mailfrom=quic_cgoldswo@quicinc.com X-HE-Tag: 1632809547-43099 Content-Transfer-Encoding: quoted-printable 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 Tue, Sep 28, 2021 at 02:22:59AM +0300, Georgi Djakov wrote: > On 9/27/2021 6:51 PM, David Hildenbrand wrote: > >On 24.09.21 00:54, Chris Goldsworthy wrote: > >>From: Sudarshan Rajagopalan > >> > >>After new memory blocks have been hotplugged, max_pfn and max_low_pfn > >>needs updating to reflect on new PFNs being hot added to system. > >> > >>Signed-off-by: Sudarshan Rajagopalan > >>Signed-off-by: Chris Goldsworthy > >>--- > >>=A0 arch/arm64/mm/mmu.c | 5 +++++ > >>=A0 1 file changed, 5 insertions(+) > >> > >>diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c > >>index cfd9deb..fd85b51 100644 > >>--- a/arch/arm64/mm/mmu.c > >>+++ b/arch/arm64/mm/mmu.c > >>@@ -1499,6 +1499,11 @@ int arch_add_memory(int nid, u64 start, u64 si= ze, > >>=A0=A0=A0=A0=A0 if (ret) > >>=A0=A0=A0=A0=A0=A0=A0=A0=A0 __remove_pgd_mapping(swapper_pg_dir, > >>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 __= phys_to_virt(start), size); > >>+=A0=A0=A0 else { > >>+=A0=A0=A0=A0=A0=A0=A0 max_pfn =3D PFN_UP(start + size); > >>+=A0=A0=A0=A0=A0=A0=A0 max_low_pfn =3D max_pfn; > >>+=A0=A0=A0 } > >>+ > >>=A0=A0=A0=A0=A0 return ret; > > > >Note: didn't verify if updating max_low_pfn is correct here. >=20 > My understanding is that max_low_pfn defines the low/high memory > boundary and it should be also updated. >=20 > Thanks, > Georgi To build more on Georgi's response, our assumption here after an offline discussion is that max_low_pfn would not be equal to max_pfn only if ther= e is high memory - another assumption is that arm64 kernels will not need high= memory due to their large logical mappings. Under these two assumptions, the pat= ch is correct. Perhaps Catalin can ack or critique this, as he initially set ma= x_pfn =3D max_low_pfn in the first arm64 mm initialization code: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit= /?id=3Dc1cc1552616d0f354d040823151e61634e7ad01f