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 90597C433EF for ; Wed, 29 Sep 2021 10:31:28 +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 563ED613A6 for ; Wed, 29 Sep 2021 10:31:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 563ED613A6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.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-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:Cc:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=3oLCyBToopu3BrDoLjSvIsfNE81bqMhh/t/7J86vlbM=; b=GYMvZfLKa47rTNMV0WhUCaGkwA 0JFHllnqjxJ+w88U9ZR0vRFCoXcwOY1WlhVXjgPk1phHvgyGXVdNpxEgmsjj/ZJMYmxraD0PSpykZ 8oEzGu2eXIk6N9UK8u5ckHLu7g5iQHT0wG9vWRLi91E3tn+3DZYytGTiYUxj3CGDeLhWz0aNRKSbn ctO6bNfKQNCiZxR+NpTwgP5QjJtqqXvhXKkcVPnsF9f4Hht2nqqZDsoRNiutnakc9TqzK4qR8DO7b iC3wm5oKG/c/JPuS8b0VbMzN2X+IeBAT9oy4AF5LOYonpp/ioBmNaxWXYM0KBeG/Q4lQup3KPGmUK ebt7GCXw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mVWqM-00AiOf-Dw; Wed, 29 Sep 2021 10:29:42 +0000 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mVWqI-00AiNL-6Q for linux-arm-kernel@lists.infradead.org; Wed, 29 Sep 2021 10:29:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1632911377; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=C57om5FTtgEGHf0KUu9I3TAtRy+1t/YR1bYrwybiKdg=; b=ObnAfQC+oZ8P8sQE7XbRP46JkY8iKzU8AWeRQdAqNJYxjW81ojrS5OoF4omZTjqLoh0npi xEsQa64UKr4yl5VO+zvC5l6zjo1RyBZj2pG/I9Rc7Isuv/0c5PQiU1YVTSft1/2Zky2VSP IqbaXyD9Mw5gp3BX1vcb32hpXom0Xn8= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-261-LauQkst-NCyRan7Vra5mOA-1; Wed, 29 Sep 2021 06:29:35 -0400 X-MC-Unique: LauQkst-NCyRan7Vra5mOA-1 Received: by mail-wm1-f72.google.com with SMTP id n30-20020a05600c3b9e00b002fbbaada5d7so2501835wms.7 for ; Wed, 29 Sep 2021 03:29:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=C57om5FTtgEGHf0KUu9I3TAtRy+1t/YR1bYrwybiKdg=; b=xobANRfEgxC9VELNb3EjbP+UKaofg+xGJQ5Wm40T9/S8dsxTNDx64ffbNmMTEAH8zH f9KiEMqvvW59o8ehbelajpDzyVIrLy11P0d7doStTzflJo3LeTFqbl9rnz4KeKGTumcE wGnds5fTl1KaPhYuPIRM2XAlGLLVswm1z8c9TRhQ7c/1TGQjUk1nsiDlK7jz5vxk/fOq R+lb0+pbRrja3SqYPrxhXHkiQPDSbFfG/cy5TmPCxg5kI3r/624U2b7qtNO20cFX19Iu Beovy+OHei7nkp/QbbBjKoeA7rjsPYhUSGjZGI8v2+8AOMyiUoAKjXgOy+60pN4KB8an AHzg== X-Gm-Message-State: AOAM532RXeD7UIK5jWBuP6CWe4t8ZMR0+mpIXvLMkTcd9SFz9a2ysuy9 EwiB4MMwI+LiOClpnqoPXuOZ8vMEsterzLHlsrqdyRgOfQZm3NtFkhFVKhb1ACCL6ESZMoSBw6W A5OKlNvjDKtECtO3R3NjT1eBrjb1e1cHfSFg= X-Received: by 2002:adf:f550:: with SMTP id j16mr5595986wrp.41.1632911374157; Wed, 29 Sep 2021 03:29:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzoEJW17D0Lrj3daOOwl1NQdJV/1r6ta6M9qUfNhDLFaw6jkYos9wruOZx63emdJSLA+Xnxvw== X-Received: by 2002:adf:f550:: with SMTP id j16mr5595975wrp.41.1632911373970; Wed, 29 Sep 2021 03:29:33 -0700 (PDT) Received: from [192.168.3.132] (p4ff23c3b.dip0.t-ipconnect.de. [79.242.60.59]) by smtp.gmail.com with ESMTPSA id z6sm1654271wmp.1.2021.09.29.03.29.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 29 Sep 2021 03:29:33 -0700 (PDT) Subject: Re: [RFC] arm64: mm: update max_pfn after memory hotplug To: Will Deacon , Chris Goldsworthy Cc: Catalin Marinas , Andrew Morton , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Sudarshan Rajagopalan References: <595d09279824faf1f54961cef52b745609b05d97.1632437225.git.quic_cgoldswo@quicinc.com> <20210929101028.GB21057@willie-the-truck> From: David Hildenbrand Organization: Red Hat Message-ID: <13f56b37-afc7-bf6f-d544-8d6433588bf9@redhat.com> Date: Wed, 29 Sep 2021 12:29:32 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210929101028.GB21057@willie-the-truck> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210929_032938_454679_3A2DC0C9 X-CRM114-Status: GOOD ( 22.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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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. > > Will > -- Thanks, David / dhildenb _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel