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 AB9F1C433EF for ; Tue, 28 Sep 2021 06:14:33 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 6021B610E6 for ; Tue, 28 Sep 2021 06:14:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6021B610E6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=quicinc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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:MIME-Version:References: Message-ID:Subject:CC:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=I2UaleaJVWyNrKVhSn9c9fjifNXVwlivpchOyt1jbWA=; b=RpPWoASNHiyRHX 9KxDLqFkzAZ91nov/fnhlP+ZBS7D3nLe5xPrQqaH4A1dHgvh3WrI83tfRC5+lNpcqtO2v2tlzMr20 0AAsQP8VANNTAjRuLeJucfhtwplpljVZMKsRkk/zKxzZJjtwtMmKsmna12YPf/6REXS7Rfs9sE3Ly UBmV+7cC32t9782iJt7hLPJ6sIzrV7nz7Q8KGZDaRIr7hd27SKX/o7+QCpbiS4zfTKgA1MkTTd7Nv nAl8jIOW4bh1lB2CVNqbImJ/j3hrHiB9rY244ED8NvKeNdop0GEJ4Zst/qiqF3PqUWkIxOJiG87MW 1lZNqX1U8yfyKBIl3ZyA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mV6M1-005mvp-U3; Tue, 28 Sep 2021 06:12:38 +0000 Received: from alexa-out.qualcomm.com ([129.46.98.28]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mV6Lt-005mtn-6c for linux-arm-kernel@lists.infradead.org; Tue, 28 Sep 2021 06:12:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1632809549; x=1664345549; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=gs3m7sok0bsohq67jQzde48+nSgu0gFPpPY8ZHI02gg=; b=kVrEEvkjxZp7Bb4jCVa+CFefPZKmiye0lCapbG9EaBEypfFqGUZGNuvd jOAi7SC0lb2JzoK4VT/8PKVxY16ETi7OkarjN0TEZIBPVL0bKjYxTpS/O yeY0Dx7o1Toj4b0BluW1o+yiYvDKBAZOOAWPpmZugi5N9pZwco0mT3wHU w=; 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-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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210927_231229_379501_E1868465 X-CRM114-Status: GOOD ( 17.29 ) 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="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 size, > >>=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 __ph= ys_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. > = > My understanding is that max_low_pfn defines the low/high memory > boundary and it should be also updated. > = > 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 there = is high memory - another assumption is that arm64 kernels will not need high m= emory due to their large logical mappings. Under these two assumptions, the patch= is correct. Perhaps Catalin can ack or critique this, as he initially set max_= 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel