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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 729A2C4332F for ; Sat, 1 Oct 2022 01:28:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E6E646B0072; Fri, 30 Sep 2022 21:28:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E1E5A8D0005; Fri, 30 Sep 2022 21:28:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C98468D0003; Fri, 30 Sep 2022 21:28:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id B976E6B0072 for ; Fri, 30 Sep 2022 21:28:20 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 963F9AC06A for ; Sat, 1 Oct 2022 01:28:20 +0000 (UTC) X-FDA: 79970645160.20.8FBDB34 Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) by imf15.hostedemail.com (Postfix) with ESMTP id 43FBCA0010 for ; Sat, 1 Oct 2022 01:28:19 +0000 (UTC) Received: by mail-qk1-f169.google.com with SMTP id x18so3854617qkn.6 for ; Fri, 30 Sep 2022 18:28:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date; bh=NKdvHvQ44i5cKwfP63cHSA4v+56YKGXpXNp8A2uLGk0=; b=FCZdmHTXpzPh+SsHcbqp1NVBPvLVyGUTI1Z1NrHdkhsxdmOLtckQ+AzroORVm1xfbe 2AvWitpo2qrn4401punrBuO2gNFE91JNc+rQ1OCv9ksC57ugddx+WD5k81UvZVKyBOKU GcW8Zu1WDE+3ah0ndtw+iZfXjhkMdRQejkPL6LrAAcTuiJScy1cRNcszUY2Yuqxh08qm F+ApvDwF0URuQHgg4L9QcIpp6e8GG2AnZhQyoez77JPvDJKuA0Euu0u0rCPg1oXU0RUz KI4iW7LC4VjML5NNLxTUtt7Vk5ezCWqemRdQpktx9/NvbPWiSanwnpcM1SxTmjYTDyob gv8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date; bh=NKdvHvQ44i5cKwfP63cHSA4v+56YKGXpXNp8A2uLGk0=; b=TV64ILMsAU0PJYf1hJvCie6fGIs4uHUeFhZ7dukvERPzplO8XjQVbgTXPvt5lbhK55 hphrc+79eHSPVkQBJqve3qqfVo8BHyH1QkNQIO+RZyV4dI2k6lB98Rl2IQ5EsEnu6n+Q ZU+pzY9t/c2aBDvbznIYXP4XrS4fzon/gByKdodsrVNwXN9C9NSNvdUAn/QsJgp6i7Rd gyk/UzhXTiMsenL+le+6yFd+4N5XBNpCHlmE9dMUmRss6b1E8iAFgYvp4yZ8ichyqvUl tADwsmY/lbVT8rTPvsRaW24Ql1Pp5qT7h8AKCwtkeqXO9lYGwc/DVUEKnxzLxp4peEEg 7inA== X-Gm-Message-State: ACrzQf1fzSVFb7pn6A5XNuOkcflJ7TBVYnTzo+7HmEmga2fHDdW58+Zn 0RK4qojICTL4ixwRBbcZoMk= X-Google-Smtp-Source: AMsMyM5yIKxAHMaIcYqUfvWo5dav+HCUqxOsA5j4NLkufoQwILTy6jGJJb9OrwbCTNdnhlkr/R4qGA== X-Received: by 2002:a37:a98c:0:b0:6cf:9ca3:b2fd with SMTP id s134-20020a37a98c000000b006cf9ca3b2fdmr8331629qke.118.1664587698484; Fri, 30 Sep 2022 18:28:18 -0700 (PDT) Received: from [10.69.53.73] ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id a16-20020a05620a16d000b006b58d8f6181sm3814147qkn.72.2022.09.30.18.28.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 30 Sep 2022 18:28:17 -0700 (PDT) Message-ID: Date: Fri, 30 Sep 2022 18:28:14 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.1.2 Subject: Re: [PATCH v2 2/9] mm/vmstat: show start_pfn when zone spans pages Content-Language: en-US To: David Hildenbrand , Andrew Morton Cc: Jonathan Corbet , Mike Rapoport , Borislav Petkov , "Paul E. McKenney" , Neeraj Upadhyay , Randy Dunlap , Damien Le Moal , Muchun Song , KOSAKI Motohiro , Mel Gorman , Mike Kravetz , Florian Fainelli , Oscar Salvador , Michal Hocko , Joonsoo Kim , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org References: <20220928223301.375229-1-opendmb@gmail.com> <20220928223301.375229-3-opendmb@gmail.com> <8e61d0f4-0c40-6c2d-da60-fa97e2ee7530@redhat.com> From: Doug Berger In-Reply-To: <8e61d0f4-0c40-6c2d-da60-fa97e2ee7530@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1664587699; h=from:from:sender: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:dkim-signature; bh=NKdvHvQ44i5cKwfP63cHSA4v+56YKGXpXNp8A2uLGk0=; b=2qXl7Jo4xLT/1KrbUf957t45yrZjevAF2mPWUF4a9HA1r5MKBUFct7mW7k/szotz/GIGZo UYT1BZZktB5oJZJvapflJ+hoeTLS3dxgw+d30Dv1Vu+c+f4kKJ+cE6l4+ycUgCdzpmb/Ut J5woNV7iYM3kHFdAvIbFsFP8G6WjAFQ= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=FCZdmHTX; spf=pass (imf15.hostedemail.com: domain of opendmb@gmail.com designates 209.85.222.169 as permitted sender) smtp.mailfrom=opendmb@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1664587699; a=rsa-sha256; cv=none; b=TY76toOLn02SurScciuiUTyT1zimppi6S8fj1QdjTCZIF2T6G6+GkYAvqjhmGeNYHOQOA0 Z1SEhmy+e2n1ubAUr8HbLsCs4hlA3GUHzWa3slQxVTNXvqMJ2CVvHPaPQmKd3PXOkGS4qz HxVhtbCPWzHMAJ3Sp08ll+0r/R5pfu4= X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 43FBCA0010 Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=FCZdmHTX; spf=pass (imf15.hostedemail.com: domain of opendmb@gmail.com designates 209.85.222.169 as permitted sender) smtp.mailfrom=opendmb@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Stat-Signature: yxkmg3gyxs4zdk8a47pd6bbzrq9c6k9b X-HE-Tag: 1664587699-62364 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/29/2022 1:15 AM, David Hildenbrand wrote: > On 29.09.22 00:32, Doug Berger wrote: >> A zone that overlaps with another zone may span a range of pages >> that are not present. In this case, displaying the start_pfn of >> the zone allows the zone page range to be identified. >> > > I don't understand the intention here. > > "/* If unpopulated, no other information is useful */" > > Why would the start pfn be of any use here? > > What is the user visible impact without that change? Yes, this is very subtle. I only caught it while testing some pathological cases. If you take the example system: The 7278 device has four ARMv8 CPU cores in an SMP cluster and two memory controllers (MEMCs). Each MEMC is capable of controlling up to 8GB of DRAM. An example 7278 system might have 1GB on each controller, so an arm64 kernel might see 1GB on MEMC0 at 0x40000000-0x7FFFFFFF and 1GB on MEMC1 at 0x300000000-0x33FFFFFFF. Placing a DMB on MEMC0 with 'movablecore=256M@0x70000000' will lead to the ZONE_MOVABLE zone spanning from 0x70000000-0x33fffffff and the ZONE_NORMAL zone spanning from 0x300000000-0x33fffffff. If instead you specified 'movablecore=256M@0x70000000,512M' you would get the same ZONE_MOVABLE span, but the ZONE_NORMAL would now span 0x300000000-0x32fffffff. The requested 512M of movablecore would be divided into a 256MB DMB at 0x70000000 and a 256MB "classic" movable zone start would be displayed in the bootlog as: [ 0.000000] Movable zone start for each node [ 0.000000] Node 0: 0x000000330000000 Finally, if you specified the pathological 'movablecore=256M@0x70000000,1G@12G' you would still have the same ZONE_MOVABLE span, and the ZONE_NORMAL span would go back to 0x300000000-0x33fffffff. However, because the second DMB (1G@12G) completely overlaps the ZONE_NORMAL there would be no pages present in ZONE_NORMAL and /proc/zoneinfo would report ZONE_NORMAL 'spanned 262144', but not where those pages are. This commit adds the 'start_pfn' back to the /proc/zoneinfo for ZONE_NORMAL so the span has context. Regards, Doug > >> Signed-off-by: Doug Berger >> --- >>   mm/vmstat.c | 5 +++++ >>   1 file changed, 5 insertions(+) >> >> diff --git a/mm/vmstat.c b/mm/vmstat.c >> index 90af9a8572f5..e2f19f2b7615 100644 >> --- a/mm/vmstat.c >> +++ b/mm/vmstat.c >> @@ -1717,6 +1717,11 @@ static void zoneinfo_show_print(struct seq_file >> *m, pg_data_t *pgdat, >>       /* If unpopulated, no other information is useful */ >>       if (!populated_zone(zone)) { >> +        /* Show start_pfn for empty overlapped zones */ >> +        if (zone->spanned_pages) >> +            seq_printf(m, >> +                   "\n  start_pfn:           %lu", >> +                   zone->zone_start_pfn); >>           seq_putc(m, '\n'); >>           return; >>       }