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 X-Spam-Level: X-Spam-Status: No, score=-13.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ED5B4C433EF for ; Thu, 23 Sep 2021 22:57:29 +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 B26B9610C9 for ; Thu, 23 Sep 2021 22:57:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B26B9610C9 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:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=Zt47RHsThvsg7naCk0ye7cRbmqALRHKZij4kPyR5fxE=; b=038uHpnSMIbEKg oXnCue7uF6KoPOTB1dWJlgircKykCi6pLmIa9fh3a378qEdCC1FciDHE381T88C9NH3Amjn5I7q5q 3FQU2V5tkocuGQtp5Y77yoblrvwfqs81O6q96dkoxts7758HHhQIxajHeIsX/BiDt3XjU4c7KHhtL z5HtwNyK+hfEboPJeIghEh+qzlrqwddyiATKco2kk03mcGx+OC9xGAXR45O4W5RifAaFCnKh1Rqxd p00ck486KhTp+p4rUIFkEwdD+zyHJLb0SCxrX7GSlydAoK6WzOzCjIfObkRezk9O79G7UGlMyOT8f YFzoY3UkKPDy4nea0joQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mTXcS-00CiXa-IE; Thu, 23 Sep 2021 22:55:08 +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 1mTXcJ-00CiUv-Du for linux-arm-kernel@lists.infradead.org; Thu, 23 Sep 2021 22:55:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1632437699; x=1663973699; h=from:to:cc:subject:date:message-id:mime-version; bh=e97zNOiwir1aJze+wIByrdjedbkrWs1OwK8P/jZcHPw=; b=fz7KZpEUdIyesSEodJdt+hsySH1Nl2iVcv6bdnGIVHIgqY3VkhF1xKQQ NXPJr31Llwue+qPBd0TE/RULs0H/O74Mb3zGNwMffinyf1EkDRrrwa5RN C9vmgVB9CdSD/BQ3D8HjKiSEI9/1vXedkF/bNlGuXC45tM7jiRZ4pbfQA U=; Received: from ironmsg08-lv.qualcomm.com ([10.47.202.152]) by alexa-out.qualcomm.com with ESMTP; 23 Sep 2021 15:54:57 -0700 X-QCInternal: smtphost Received: from nalasex01a.na.qualcomm.com ([10.47.209.196]) by ironmsg08-lv.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Sep 2021 15:54:56 -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; Thu, 23 Sep 2021 15:54:55 -0700 From: Chris Goldsworthy To: Catalin Marinas , Will Deacon , Andrew Morton CC: David Hildenbrand , , , , Chris Goldsworthy Subject: [RFC] arm64: mm: update max_pfn after memory hotplug Date: Thu, 23 Sep 2021 15:54:47 -0700 Message-ID: X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) 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-20210923_155459_953426_1C872890 X-CRM114-Status: UNSURE ( 8.99 ) X-CRM114-Notice: Please train this message. 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 arm64 we set max_pfn at boot in arch/arm64/mm/init.c. If you hotplug in memory after booting up, max_pfn is not updated. This breaks diagnostic functions executed from user space like read_page_owner(): https://elixir.bootlin.com/linux/v5.14.7/source/mm/page_owner.c#L472 or kpageflags_read() (see how get_max_dump_pfn() is used): https://elixir.bootlin.com/linux/v5.14.7/source/fs/proc/page.c#L47 Thus, this patch updates max_pfn and max_low_pfn in arm64's arch_add_memory() function, mirroring what is updatated during boot: https://elixir.bootlin.com/linux/v5.14.7/source/arch/arm64/mm/init.c#L448 We would appreciate feedback on any other variables that should be updated when hotplugging in memory - note that we're mirroring x86, in that max_pfn is only ever incremented when calling arch_add_memory(): https://elixir.bootlin.com/linux/v5.14.7/source/arch/x86/mm/init_64.c#L958 Sudarshan Rajagopalan (1): arm64: mm: update max_pfn after memory hotplug arch/arm64/mm/mmu.c | 5 +++++ 1 file changed, 5 insertions(+) -- 2.7.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel