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 A41DBC433FE for ; Mon, 27 Sep 2021 20:00:34 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2ABD161156 for ; Mon, 27 Sep 2021 20:00:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2ABD161156 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=quicinc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 72EE06B0071; Mon, 27 Sep 2021 16:00:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6DF11940009; Mon, 27 Sep 2021 16:00:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5814E940008; Mon, 27 Sep 2021 16:00:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0105.hostedemail.com [216.40.44.105]) by kanga.kvack.org (Postfix) with ESMTP id 49B796B0071 for ; Mon, 27 Sep 2021 16:00:33 -0400 (EDT) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 020958249980 for ; Mon, 27 Sep 2021 20:00:33 +0000 (UTC) X-FDA: 78634420746.05.90922F1 Received: from alexa-out-sd-02.qualcomm.com (alexa-out-sd-02.qualcomm.com [199.106.114.39]) by imf01.hostedemail.com (Postfix) with ESMTP id 66A36506898E for ; Mon, 27 Sep 2021 20:00:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1632772832; x=1664308832; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=U+HxWlzaap1cTUdokhUeAOM8SlcfwsApx2dPHFjNzJI=; b=uUQv5RrqjAc4WAUociXBfW0qca0t8RiCZCNo4Beyo79dMlY1wo97cOdc 6x5bbWjBsrVi6ijyBXY18YDqLgIuZMFlmUCNdhDToFj0aLPnTlxhzUJdg A7Ic/I+pFKk3akYhD18l0u1e2Y8e02xK4I+o6r3TpCkcLBWflOPl+GA2l Y=; Received: from unknown (HELO ironmsg01-sd.qualcomm.com) ([10.53.140.141]) by alexa-out-sd-02.qualcomm.com with ESMTP; 27 Sep 2021 13:00:31 -0700 X-QCInternal: smtphost Received: from unknown (HELO nasanex01a.na.qualcomm.com) ([10.52.223.231]) by ironmsg01-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Sep 2021 13:00:30 -0700 Received: from [10.251.44.228] (10.80.80.8) by nasanex01a.na.qualcomm.com (10.52.223.231) 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 13:00:28 -0700 Message-ID: Date: Mon, 27 Sep 2021 23:00:25 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.1.1 Subject: Re: [RFC] arm64: mm: update max_pfn after memory hotplug Content-Language: en-US To: David Hildenbrand , Chris Goldsworthy , Catalin Marinas , "Will Deacon" , Andrew Morton CC: , , , Sudarshan Rajagopalan References: <595d09279824faf1f54961cef52b745609b05d97.1632437225.git.quic_cgoldswo@quicinc.com> <4f4f6e93-ddc2-c9bb-ef47-4a40f2c3d0d7@quicinc.com> <1b9c4377-0a6b-b7d4-7a6b-a69f9469bb70@redhat.com> From: Georgi Djakov In-Reply-To: <1b9c4377-0a6b-b7d4-7a6b-a69f9469bb70@redhat.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01a.na.qualcomm.com (10.52.223.231) X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 66A36506898E X-Stat-Signature: u6asr8jacq8opdzommj8u7e17a9d3yx1 Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=quicinc.com header.s=qcdkim header.b=uUQv5Rrq; spf=pass (imf01.hostedemail.com: domain of quic_c_gdjako@quicinc.com designates 199.106.114.39 as permitted sender) smtp.mailfrom=quic_c_gdjako@quicinc.com; dmarc=pass (policy=none) header.from=quicinc.com X-HE-Tag: 1632772832-620989 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 9/27/2021 8:34 PM, David Hildenbrand wrote: > On 27.09.21 19:22, Georgi Djakov wrote: >> On 9/24/2021 1:54 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. >>> >>> Signed-off-by: Sudarshan Rajagopalan >>> Signed-off-by: Chris Goldsworthy >> >> Thanks for the patch, Chris! >> >> With this patch, the data in /proc/kpageflags appears to be correct and >> memory tools like procrank work again on arm64 platforms. >> >> Tested-by: Georgi Djakov >> >> Maybe we should add fixes tag, as it has been broken since the following >> commit: >> Fixes: abec749facff ("fs/proc/page.c: allow inspection of last section >> and fix end detection") > > Are you sure that that commit broke it? Reverting the above commit also "fixes" kpageflags, otherwise kpageflags_read() returns 0 in the following check: if (src >= max_dump_pfn * KPMSIZE) return 0; > I recall that we would naturally run into the limit, because > > count = min_t(size_t, count, (max_pfn * KPMSIZE) - src); The function returns before we reach this line. Thanks, Georgi > wouldn't really do what you would expect either. But you could > force-read beyond max_pfn, yes, because the count computation was just > weird. > > > I think the real issue is not properly adjusting max_pfn in the first > place when we introduced memoruy hotplug on arm64