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 8D0EFC433EF for ; Mon, 27 Sep 2021 20:16:23 +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 5129F60FED for ; Mon, 27 Sep 2021 20:16:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5129F60FED 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=yD/bE9BxLHuBNLkpgtmIIFKejG9WU0p0d7s77crZxmc=; b=GQjInTTMnUs7gB24Pr4qt0Lb35 ze978PMUkK1YscW8gxPvCnpXBwp+6Yuq5UXI/cSSdnZ0c55U+TX5HirAzlSi8bein4IOwgF0eXBjv +TqEGEoJVFDCn6+E8jyoogfqBiwvUsu91s/dC9IkdUFyzWcb25jGAHDNuSxtDf2oXiop568ncvrIh YYZNm73zQcjgNFpNeksZiEWzJjavqYOBTpR7j4N5G5zH4hu4mHsKBrN2H/TPsMSJmogdlX0NIQfLi h3e2dmAxJvNyz0Zx3fKJYB/YGIurf2j0N+Qw203xTaBkmXO3FPwrqo2z00AvYzE5vfkgz9bSItIoP ztj4QfWQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mUx1E-0048p3-RM; Mon, 27 Sep 2021 20:14:33 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mUx1B-0048oB-B7 for linux-arm-kernel@lists.infradead.org; Mon, 27 Sep 2021 20:14:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1632773668; 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=eP062b5mhij72Si8HOUBM9YnUPhiFEqkb3Ae5lpg9zxf5J4zHpw1pxe6OEFruSD2Snqnom 72KoxECycuVu/6Ojl7KqpSrCqQUYOEzZe0gm9E4zDjZO/X6jPCJoX+Ej6dc2HwmOmR1780 cqY1pPi+veBemHjD76bSdjIuquJI4Mg= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-52-CQgWiIFTPPWyloTYNraNQQ-1; Mon, 27 Sep 2021 16:14:27 -0400 X-MC-Unique: CQgWiIFTPPWyloTYNraNQQ-1 Received: by mail-wm1-f71.google.com with SMTP id 17-20020a05600c029100b00305eac9f29aso343113wmk.1 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=i3ILcppVC3ANj/Yp+3fKjiArDPuUL8/Rg7xPeS4r75OK2eDH/CpGXiGZojdDpGDMho 696iyT5Z1ZolUXrsgYCn14EDNDqgsbj1NMFGC5o68xdn+rJ1pD1nzoGJw4tSuRbyZVY/ BKBu8SpUZwTNkhPiAJ29SkhPIbYZCX0dA6+iHiZhp2TPFfZWq3NUR8R/Vz9xZ+Xkal26 g5r8oVLWi2hMEHwzJqfXeclIFtGkSu0iYWVuX7arpEk5boMKhgWazUny7BHdIFu//Et9 +l3CgFttTY0NeYa7YqD+Ehw7msFTUQJzIzi2VWFLbuHKQ5VCgD7x8e7J9EjjpGv9hXS0 6LoQ== X-Gm-Message-State: AOAM5305/SDGatBhbspOyHA3iUr5pV76USqbZ6rcsuQx1HvAoadwa8ML E/TsVQ3MKGBnlmySmP2sT6/QudK/X1yt+lkxOV21SArMOM3ztkvxuKXnF1Ed1AUOq5wu6P2R9lF SCcMMU9z2iIXSOnKXpfwAlpaewPnqzo0Ht0A= X-Received: by 2002:a05:6000:1a89:: with SMTP id f9mr2082665wry.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: 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-20210927_131429_489930_3D6D0974 X-CRM114-Status: GOOD ( 20.77 ) 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 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel