Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp1016128pxb; Fri, 1 Oct 2021 01:13:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxclYYa2Ygpp6CQ96AeFGkFyHmo20zbbFexMcQynIeuvP1PpQNzP321M2UJhfuhFnSxZY/i X-Received: by 2002:a65:5ac1:: with SMTP id d1mr8670187pgt.246.1633076003206; Fri, 01 Oct 2021 01:13:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633076003; cv=none; d=google.com; s=arc-20160816; b=uvOXv7pBK4egD/Lr9OdUIGPeowQpLvKUrO+26QiMa7StczM+X8N4E0M12VUXFM86Hj c7fNHQSxnxD3BIwVVX003UofjuanichEChWuLlsGISrKKmKg50k6ArQWsYhE/kCNxBds +VyNeFqvZg23hzfLyegP5q0o7ND/tx/dWAQovEyn2o3tnYlNiCtlN/1qW3pw4w5mwbuo M6yY+wIbrd/c7OzAa/Mm9uukI+OKd/n/ebbGlznf/Cd4+n8jCDorvpjppJsbOchX9rSH 4FPMag2rSbwiRlGPhcFuCX6idZs3/qKGPQn0tvGbIOUGBsZnn0P1ErDOY4aHM7DNVyfi YmNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=RDPAWY2jLVG+KWGNB0OP4BqEQ/GkJMHHSQ6k/hgTIXU=; b=SKCZr4FpiOqr3Z8bfeAu8NV1LdGgBOPpobfbuikwrjdkm852lsnhR66XdWzB9dWKr1 /YcAbxKCDQOmYcJ88U61r23S2uOwPSXpIWrPGRUkegq9+RVNBRTq60mandZTuGg9fbS6 DgOFaoJbA9Zm7XLKCaP7bjCI46SsYlT8lUEkbP6ONAC61i9P7Ck91AkHb8fG5hybLpY4 jg3ImYivXpJGKardf+9WYJYE/47cv82LrYT/quC1jgYgbRM3qZ8rwak/+IGWyaFC+eOu VZkATY5yFPjSwF2fZBcIKDR+7tuXHHiHVhQ4uPSYtYpR5xXgdfRAMM28QsKprjao9drc TsgQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b11si8570762plg.452.2021.10.01.01.13.08; Fri, 01 Oct 2021 01:13:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1352215AbhJAGit (ORCPT + 99 others); Fri, 1 Oct 2021 02:38:49 -0400 Received: from foss.arm.com ([217.140.110.172]:36304 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230397AbhJAGiq (ORCPT ); Fri, 1 Oct 2021 02:38:46 -0400 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 1662B113E; Thu, 30 Sep 2021 23:37:02 -0700 (PDT) Received: from [10.163.74.5] (unknown [10.163.74.5]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DC9613F718; Thu, 30 Sep 2021 23:36:58 -0700 (PDT) Subject: Re: [PATCH] arm64: mm: update max_pfn after memory hotplug To: Chris Goldsworthy , Andrew Morton Cc: David Hildenbrand , Catalin Marinas , Will Deacon , Sudarshan Rajagopalan , Georgi Djakov , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Florian Fainelli References: From: Anshuman Khandual Message-ID: Date: Fri, 1 Oct 2021 12:08:05 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/29/21 12:21 AM, 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. > Without this patch, debug-related functions that use max_pfn such as > get_max_dump_pfn() or read_page_owner() will not work with any page in > memory that is hot-added after boot. > > Fixes: 4ab215061554 ("arm64: Add memory hotplug support") > Signed-off-by: Sudarshan Rajagopalan > Signed-off-by: Chris Goldsworthy > Acked-by: David Hildenbrand > Cc: Florian Fainelli > Cc: Georgi Djakov > --- > arch/arm64/mm/mmu.c | 5 +++++ > 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, > if (ret) > __remove_pgd_mapping(swapper_pg_dir, > __phys_to_virt(start), size); > + else { > + max_pfn = PFN_UP(start + size); > + max_low_pfn = max_pfn; > + } Do these variables get updated on *all* platforms that support memory hotplug via an arch_add_memory() ? If not, dont they all face similar issues as well ? Why not just update these in generic hotplug instead , after looking into arch_add_memory() return code. > + > return ret; > } > >