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 CA555C433EF for ; Mon, 27 Sep 2021 23:02:00 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 526D260FBF for ; Mon, 27 Sep 2021 23:02:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 526D260FBF 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 729436B0071; Mon, 27 Sep 2021 19:01:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6B344900002; Mon, 27 Sep 2021 19:01:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 554CC6B0073; Mon, 27 Sep 2021 19:01:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0193.hostedemail.com [216.40.44.193]) by kanga.kvack.org (Postfix) with ESMTP id 463736B0071 for ; Mon, 27 Sep 2021 19:01:59 -0400 (EDT) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id EE15C30C7D for ; Mon, 27 Sep 2021 23:01:58 +0000 (UTC) X-FDA: 78634877916.18.38FB5DF Received: from alexa-out-sd-01.qualcomm.com (alexa-out-sd-01.qualcomm.com [199.106.114.38]) by imf14.hostedemail.com (Postfix) with ESMTP id 501296001980 for ; Mon, 27 Sep 2021 23:01:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1632783718; x=1664319718; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=PmUVbG1MiN0eKwMMKY46OwxYpCX02NRiZvVDnTiF0qc=; b=G/CidZtrRpN3T/McEgY7wjgXGLFJUUqpibVSoNJQROU3/EWe60NBKVGn y5bSryAtrBIFy8zXAZeIclisuZh2/sq01dcUzMI6Ec/XgZUbGa+fJclSc aOCf+hYKNh+jgFJsm1lV8XF+Gj7FNP7DG34Svcnact09lEnTydH+vmgld w=; Received: from unknown (HELO ironmsg01-sd.qualcomm.com) ([10.53.140.141]) by alexa-out-sd-01.qualcomm.com with ESMTP; 27 Sep 2021 16:01:57 -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 16:01:57 -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 16:01:54 -0700 Message-ID: <5f8b7faf-5ea5-2d7a-4486-3515d295a49e@quicinc.com> Date: Tue, 28 Sep 2021 02:01:45 +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: 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) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=quicinc.com header.s=qcdkim header.b="G/CidZtr"; spf=pass (imf14.hostedemail.com: domain of quic_c_gdjako@quicinc.com designates 199.106.114.38 as permitted sender) smtp.mailfrom=quic_c_gdjako@quicinc.com; dmarc=pass (policy=none) header.from=quicinc.com X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 501296001980 X-Stat-Signature: c6rgrkado43jmn1bqadnd4ij9gz61rof X-HE-Tag: 1632783718-262323 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 11:14 PM, David Hildenbrand wrote: > On 27.09.21 22:00, Georgi Djakov wrote: >> 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. > > That is the old code. I don't see how the behavior of the old code with > wrong max_pfn was doing what it's supposed to do. > > page_idle and page_owner also rely on max_pfn. The root issue is that > max_pfn wasn't updated properly. Ok, i agree that this is not really fixing abec749facff, as it only reveals the real issue, so then the fixes tag should be even further back to: Fixes: 4ab215061554 ("arm64: Add memory hotplug support") Thanks, Georgi