Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp557865rdf; Fri, 3 Nov 2023 08:21:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHN2m7y1mA0to63aYVuDjy4DEWrmqY4i6soEZ8rf9GdfOLFpb71SLufjmkLt6Z9eU9THcLY X-Received: by 2002:a17:906:6a1a:b0:9be:58e4:376 with SMTP id qw26-20020a1709066a1a00b009be58e40376mr7258353ejc.46.1699024881705; Fri, 03 Nov 2023 08:21:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699024881; cv=none; d=google.com; s=arc-20160816; b=bL4s0fv3MxhBF4V44JVcQmr9d8tIgQVFgmcaI5v9cAS4XEMTWOuCwi8DG/p2COPUTo +/6xcgI8bq5aQEHV1AyUGUOKDFviomSmI83XI7w6ghqxZ/pbIWtxUP97JFVNdzDe3meV 80BI2o60Z3hnCmpRfXkBUcL0RyUt3GsIzrMnryQ8285cnXDF5DZUD8F7TV9i0Bg0MeO5 PZ/m94LRXTDCc3m9CN/uGSVqvRQmlI9iPIujP6HXQAKVZIEhXQKNbpcUV6WGQaAYTkKu 9XjbLNcuouT5pleURcpZIvVX6Z7s6MQF8CDRjB2wYLIghjtB+loSaLYXiUPYfBZxvgmZ k7Eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=liLeXSkpooaWOUPaSwHhbbjwtzRLYBJW04zYO+tuOmo=; fh=LG/qRHl6NvcbOJIwP5ehkbx+ZMq6qm2lEK82MtINYRQ=; b=lysOGQDnPt5B8o7notXwDBka1Wwvp6c9HejyILfP0u1kNtyIH+9LQz7E8NnGeh96hg NB8SashxPX0tXXHJjJrTfHMtP9+a/nhR8Nb6J2j3PrIw/5JwAUtjwfgtG/Euyya1k4RU tjtVe4aj4+MK3BjKowtry3dQJc2aqReaGquxd7PNoqYGT16e0IulmUfWRP8PV2qHQ0/R AF+m45qkwrGDmHdqtJS+2JDiOlKCBQ3QrJGriGxnxtjwjDclLcRz+V4z+rTYpsg/GjZ0 K11X23HX7e+kRLcKP6+R/k5HZsLp8d68ke7pqQV3pYY7o8uAvpj1aE6tBd6VFIr6Zz3H 7PUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b=eo5HRjTi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id dr21-20020a170907721500b009ae39e905a4si1036749ejc.241.2023.11.03.08.21.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 08:21:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b=eo5HRjTi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 30814808E8E6; Fri, 3 Nov 2023 08:20:28 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233827AbjKCPTk (ORCPT + 99 others); Fri, 3 Nov 2023 11:19:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233463AbjKCPTi (ORCPT ); Fri, 3 Nov 2023 11:19:38 -0400 Received: from mail-oi1-x22b.google.com (mail-oi1-x22b.google.com [IPv6:2607:f8b0:4864:20::22b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFEC7123 for ; Fri, 3 Nov 2023 08:19:31 -0700 (PDT) Received: by mail-oi1-x22b.google.com with SMTP id 5614622812f47-3b2ea7cc821so1320512b6e.1 for ; Fri, 03 Nov 2023 08:19:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; t=1699024771; x=1699629571; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=liLeXSkpooaWOUPaSwHhbbjwtzRLYBJW04zYO+tuOmo=; b=eo5HRjTi09AnDl2eHY6t9MzZGSw4diEPGBBKUnl0ywju9f+kwsTvc5k4SL+uqH/JLF 62UwlNbCk50u1itPbc4NtvUXu7wxZZg8Ao/T3dZ6zcyHd1sJHMpBddk/Iq7UPM5iyDMF jzMdxWd5DMCxG7HbR1pnU9vZ4kqQEBN0kbJlF1YtstuWX7CttkF2G4Cu5EksbxQ/HJ7u EGf1qOEXNxglfcCK2jIXOSYriUmcGBlF7ykVnYmsLSMXWMZDYCz4sQIz5IFCG5nUxY7l 3H8dso//uiuq+POHmm74MdW7SJJ2FJ8B0sgprFO8EEQMGezcpPc3UqEA44RaLIxhLsxg vGqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699024771; x=1699629571; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=liLeXSkpooaWOUPaSwHhbbjwtzRLYBJW04zYO+tuOmo=; b=RvxXs3+iiaBPhb0O8Gxc54JklqFRCg/ZXlO6wiXkfBUiQ2ZHJ3MjHXSR3ecW5kU8Rg wXEzrgXn1V4ANGt631D7+Jl0OZEVeaaXL2T8nuq/gs41ikRKZ09klWVNJ3XfahZTOalf g+NSLAhUIxDpyHMu8iC4/wq5L78OxmJ15TnfvqW7MYItvjEZoMZX0HjBOXfdqYcAYXJY YJZuxmmrcp9sQ2SoZsqMKwJYBIw0z6kknWhIGNsydM1ohKGOneOg+pBePx51PRuAouCe /xJrI0vw+b7p5fTTmCaWSHggH1PrqGV4OQEsaNY6p8c5Bw3eloy0CDH+EebHcgT0Qzun a6Fw== X-Gm-Message-State: AOJu0YwGfn6fteQ2g1EuUkah3pB4kp1bqn16zmmWz/rtHqztWhhFogzN +BVc8ZQ+QjeIiKBsFumQ7CpaoNw74BRCb8pTKlVWbA== X-Received: by 2002:a05:6808:1986:b0:3ab:84f0:b49d with SMTP id bj6-20020a056808198600b003ab84f0b49dmr26946069oib.3.1699024770996; Fri, 03 Nov 2023 08:19:30 -0700 (PDT) MIME-Version: 1.0 References: <20231101230816.1459373-1-souravpanda@google.com> <20231101230816.1459373-2-souravpanda@google.com> <1e99ff39-b1cf-48b8-8b6d-ba5391e00db5@redhat.com> <025ef794-91a9-4f0c-9eb6-b0a4856fa10a@redhat.com> <99113dee-6d4d-4494-9eda-62b1faafdbae@redhat.com> In-Reply-To: From: Pasha Tatashin Date: Fri, 3 Nov 2023 11:18:53 -0400 Message-ID: Subject: Re: [PATCH v5 1/1] mm: report per-page metadata information To: Wei Xu Cc: David Hildenbrand , Sourav Panda , corbet@lwn.net, gregkh@linuxfoundation.org, rafael@kernel.org, akpm@linux-foundation.org, mike.kravetz@oracle.com, muchun.song@linux.dev, rppt@kernel.org, rdunlap@infradead.org, chenlinxuan@uniontech.com, yang.yang29@zte.com.cn, tomas.mudrunka@gmail.com, bhelgaas@google.com, ivan@cloudflare.com, yosryahmed@google.com, hannes@cmpxchg.org, shakeelb@google.com, kirill.shutemov@linux.intel.com, wangkefeng.wang@huawei.com, adobriyan@gmail.com, vbabka@suse.cz, Liam.Howlett@oracle.com, surenb@google.com, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, willy@infradead.org, Greg Thelen Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Fri, 03 Nov 2023 08:20:28 -0700 (PDT) > > Since we are going to use two independent interfaces > > /proc/meminfo/PageMetadata and nodeN/page_metadata (in a separate file > > as requested by Greg) How about if in /proc/meminfo we provide only > > the buddy allocator part, and in nodeN/page_metadata we provide the > > total per-page overhead in the given node that include memblock > > reserves, and buddy allocator memory? > > What we want is the system-wide breakdown of kernel memory usage. It > works for this use case with the new PageMetadata counter in > /proc/meminfo to report only buddy-allocated per-page metadata. We want to report all PageMetadata, otherwise this effort is going to be useless for the majority of users. As you noted, /proc/meminfo allows us to report only the part of per-page metadata that was allocated by the buddy allocator because of an existing MemTotal bug that does not include memblock reserves. However, we do not have this limitation when we create a new nodeN/page_metadata interface, and we can document that in the sysfs ABI documentation: sum(nodeN/page_metadata) contains all per-page metadata and is superset of /proc/meminfo. The only question is how to name PageMetadata in the /proc/meminfo appropriately, so users can understand that not all page metadata is included? (of course we will also document that only the MemTotal part of page metadata is reported in /proc/meminfo) Pasha