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 5E81BC433F5 for ; Wed, 29 Sep 2021 10:44:57 +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 27D2961407 for ; Wed, 29 Sep 2021 10:44:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 27D2961407 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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=OtbtB9hKo4FzfdFXNcScP75F3vSRX6eWmgVqHVMUh1I=; b=CJ5EgDoSUH3GlD lB7JX+7blasgoi6kI2g0N6IRiG9P6wupWob+8V3Y8P2ZbwPo5zvEZLaU0BDrplM9HylalJm+T/Qtf nZQXCeCyUGBh7OVE1W/g7F1lc7U5enOAumlWMouwgqIjJTZf+xculX4Nc++mybhi8ifq1l2COF96Z SyFxxqBqHEClds0IqcnPARLpaJgoMxRqGtbr81uNpECo9g2PqNcWcztvQgcrLl7EaWI39WcL/VwME iv8DiTuNxksFzXsblc9b5AvtbiPNLurQr8MOgzZcxxFu5uEGMxnjmk3kPLspOAenNx2D3NOLGGN19 zl/8aEjiqxTKsg0rRQ2A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mVX36-00AkkR-5s; Wed, 29 Sep 2021 10:42:52 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mVX31-00AkjT-Sq for linux-arm-kernel@lists.infradead.org; Wed, 29 Sep 2021 10:42:49 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 815A4613D1; Wed, 29 Sep 2021 10:42:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1632912166; bh=nGDQTfZDv9CExyFJB0RbsDORgscyoxeg39JI2IBhJwo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Bfqdw00CNoSOGG5ZjlW9e8wvAbgKJOOqw1oxJbvmzsY+Pm12ZHpB/GpgjhkFFdzli 5icVN9aBABzGOAtkdpr7keKO5Wl3ZZvGKGVKtLcVYYbead4OO2emVRCBhHj0gW4DGB Qj71oW+JlwZdOrEP3OmLEmrdhRru4efXBTVyitAz2gUFWvF18VS2LzxPcatySh6Jg8 ntnmDWE2wtVy1gqRdsiPABenYfNGJdc14369dQlhh1P4Rqz26gbSq3kl0GSQDaY4bS 7FkmBQedVJYCHBfAWxfDKI3X8Davt2iKTi1lRGrlKNlYoOgAUDbAdwOId0N6NZtWrT i1Obz7xf72kVA== Date: Wed, 29 Sep 2021 11:42:42 +0100 From: Will Deacon To: David Hildenbrand Cc: Chris Goldsworthy , Catalin Marinas , Andrew Morton , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Sudarshan Rajagopalan Subject: Re: [RFC] arm64: mm: update max_pfn after memory hotplug Message-ID: <20210929104241.GA21395@willie-the-truck> References: <595d09279824faf1f54961cef52b745609b05d97.1632437225.git.quic_cgoldswo@quicinc.com> <20210929101028.GB21057@willie-the-truck> <13f56b37-afc7-bf6f-d544-8d6433588bf9@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <13f56b37-afc7-bf6f-d544-8d6433588bf9@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210929_034247_972475_46A91209 X-CRM114-Status: GOOD ( 24.52 ) 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="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Sep 29, 2021 at 12:29:32PM +0200, David Hildenbrand wrote: > On 29.09.21 12:10, Will Deacon wrote: > > On Thu, Sep 23, 2021 at 03:54:48PM -0700, 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 > > > --- > > > 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; > > > + } > > > > We use 'max_pfn' as part of the argument to set_max_mapnr(). Does that need > > updating as well? > > > > Do we have sufficient locking to ensure nobody is looking at max_pfn or > > max_low_pfn while we update them? > > Only the write side is protected by memory hotplug locking. The read side is > lockless -- just like all of the other pfn_to_online_page() machinery. Hmm. So the readers can see one of the variables updated but the other one stale? Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel