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 15854C433EF for ; Mon, 27 Sep 2021 20:14:39 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9768560FF2 for ; Mon, 27 Sep 2021 20:14:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9768560FF2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 3775B6B0072; Mon, 27 Sep 2021 16:14:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3262A6B0073; Mon, 27 Sep 2021 16:14:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1C7F46B0074; Mon, 27 Sep 2021 16:14:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0032.hostedemail.com [216.40.44.32]) by kanga.kvack.org (Postfix) with ESMTP id D97576B0072 for ; Mon, 27 Sep 2021 16:14:37 -0400 (EDT) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 1B87D348CD for ; Mon, 27 Sep 2021 20:14:31 +0000 (UTC) X-FDA: 78634455942.20.9836FF3 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf21.hostedemail.com (Postfix) with ESMTP id BA68DD0329EA for ; Mon, 27 Sep 2021 20:14:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1632773670; 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=bvHg/uBwvsvNY/OXqNLlISNWOe/HagnQIQssDsWD3dA=; b=OSZPwIUgs9p8puxcuHPEF9Tal+co1nFQME3eUpir+HCS+J99kptqonkdKOBewISUv9oype ns9kIAPw0tFqXRScs0PmClbAeZDsMeteKSDyRrfMu9ohWuFrqmPX8mpX8u0B60SqvB+Hnw QUS7QmiE4Kwlfbz92nVu7uzPrNWPlvg= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-177-gPwFqCjZP4WOb6OvSszr6A-1; Mon, 27 Sep 2021 16:14:27 -0400 X-MC-Unique: gPwFqCjZP4WOb6OvSszr6A-1 Received: by mail-wm1-f70.google.com with SMTP id p25-20020a1c5459000000b0030cac3d9db1so735478wmi.6 for ; Mon, 27 Sep 2021 13:14:26 -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=bvHg/uBwvsvNY/OXqNLlISNWOe/HagnQIQssDsWD3dA=; b=FdpNvMJLrvrCaIPeaDofl7kNFCSIscJ1Kr6fgpV+o0hQgjuSenPmzO9EIsPbV7+08B 4Jc81ZF2xakqgxz/U6mZO1jS7wnO6HSUVaIgiYJMXNEoeyISkGrlsPw1oKXxjDa0LABo ewX6MzxG8roZZ3Is+EOHOqfnvy+OatJYlinpLH66O6x58p1Zz+0PtWVercemKUuRqQvp yonEKnunyKxTMQbBUqrFxspc5t7zQ9u1EsSGds3mnPGmlPZq4GRlyT2Juf2fuxzXn90E t2XWVO4bculyymkz8IedvhsuRnpgUFZuEKj963EZLZ78j8qlLpZNE3ZngpXd8Z42t545 c19g== X-Gm-Message-State: AOAM533uA2YVLfL7iHFDaFHAhu9Nj3vT0+CLTe5vPwvH5eBXPVRR83t9 xEMkxMWT994dh4VYZZzYzuSYYmEzbw98ED9fVSIw9HK0NMT04PTLF2mBmSbVo8AZdiYHzK73gdK FYgsv7OjEVFs= X-Received: by 2002:a05:6000:1a89:: with SMTP id f9mr2082668wry.19.1632773665902; Mon, 27 Sep 2021 13:14:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyN4QKYLs7/bVq6YJ7XOJ00JOhlzDFUGM93dO6ngMGXtGto0IGpFm1da0SdSN7xfl27cmIkFA== X-Received: by 2002:a05:6000:1a89:: with SMTP id f9mr2082654wry.19.1632773665760; Mon, 27 Sep 2021 13:14:25 -0700 (PDT) Received: from [192.168.3.132] (p5b0c654d.dip0.t-ipconnect.de. [91.12.101.77]) by smtp.gmail.com with ESMTPSA id s13sm472595wmc.47.2021.09.27.13.14.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 27 Sep 2021 13:14:25 -0700 (PDT) Subject: Re: [RFC] arm64: mm: update max_pfn after memory hotplug To: Georgi Djakov , Chris Goldsworthy , Catalin Marinas , Will Deacon , Andrew Morton Cc: 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> <4f4f6e93-ddc2-c9bb-ef47-4a40f2c3d0d7@quicinc.com> <1b9c4377-0a6b-b7d4-7a6b-a69f9469bb70@redhat.com> From: David Hildenbrand Organization: Red Hat Message-ID: Date: Mon, 27 Sep 2021 22:14:24 +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: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=OSZPwIUg; spf=none (imf21.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 216.205.24.124) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: BA68DD0329EA X-Stat-Signature: 9ku7r6nhxnbb87omhax5dsxb39koixy5 X-HE-Tag: 1632773670-988977 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 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. -- Thanks, David / dhildenb