linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Sourav Panda <souravpanda@google.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: corbet@lwn.net, gregkh@linuxfoundation.org, rafael@kernel.org,
	 mike.kravetz@oracle.com, muchun.song@linux.dev, rppt@kernel.org,
	 david@redhat.com, rdunlap@infradead.org,
	chenlinxuan@uniontech.com,  yang.yang29@zte.com.cn,
	tomas.mudrunka@gmail.com, bhelgaas@google.com,
	 ivan@cloudflare.com, pasha.tatashin@soleen.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, weixugc@google.com
Subject: Re: [PATCH v7 0/1] mm: report per-page metadata information
Date: Thu, 8 Feb 2024 10:36:05 -0800	[thread overview]
Message-ID: <CANruzcQNMmRYZh9pC_Qs5FWFv3OagzxWG+bX7Ek6VouygUwjtA@mail.gmail.com> (raw)
In-Reply-To: <20240207150503.ca18b372f899091af5e6c40b@linux-foundation.org>

[-- Attachment #1: Type: text/plain, Size: 2299 bytes --]

On Wed, Feb 7, 2024 at 3:05 PM Andrew Morton <akpm@linux-foundation.org>
wrote:

> On Mon, 29 Jan 2024 14:42:03 -0800 Sourav Panda <souravpanda@google.com>
> wrote:
>
> > This patch adds two new per-node fields, namely nr_page_metadata and
> > nr_page_metadata_boot to /sys/devices/system/node/nodeN/vmstat and a
> > global PageMetadata field to /proc/meminfo. This information can be
> > used by users to see how much memory is being used by per-page
> > metadata, which can vary depending on build configuration, machine
> > architecture, and system use.
>
> I'm not seeing why this is very useful.  OK, you look at it and it
> tells you a number, but what action can a user take based upon that
> number?
>
> Please tell us more about the value of this, the use cases, what
> prompted you to expend effort on this.
>

Hi Andrew,

Thank you for looking into this.

Application Optimization: Depending on the kernel version and command line
options, the kernel would relinquish a different number of pages (that
contain struct pages) when a hugetlb page is reserved (e.g., 0, 6 or 7 for
a 2MB hugepage). The userspace application would want to know the exact
savings achieved through page metadata deallocation without dealing with
the intricacies of the kernel.

Observability: Struct page overhead can only be calculated on-paper at boot
time (e.g., 1.5% machine capacity). Beyond boot once hugepages are reserved
or memory is hotplugged, the computation becomes complex. Per-page metrics
will help explain part of the system memory overhead, which shall help
guide memory optimizations and memory cgroup sizing.

Debugging: Tracking the changes or absolute value in struct pages can help
detect anomalies as they can be correlated with other metrics in the
machine (e.g., memtotal, number of huge pages, etc).

page_ext overheads: Some kernel features such as page_owner
page_table_check that use page_ext can be optionally enabled via kernel
parameters. Having the total per-page metadata information helps users
precisely measure impact.

In the version 8, that I will send out soon, I'll integrate the above into
the commit log. Also, following Johannes Weiner's suggestion, I'll rename
nr_page_metadata to nr_memmap.

Thank you,
Sourav

[-- Attachment #2: Type: text/html, Size: 2776 bytes --]

      reply	other threads:[~2024-02-08 18:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-29 22:42 Sourav Panda
2024-01-29 22:42 ` [PATCH v7 1/1] " Sourav Panda
2024-01-29 22:52   ` Greg KH
2024-01-30 16:57     ` Sourav Panda
2024-01-30 17:09     ` Yosry Ahmed
2024-02-07 23:05 ` [PATCH v7 0/1] " Andrew Morton
2024-02-08 18:36   ` Sourav Panda [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CANruzcQNMmRYZh9pC_Qs5FWFv3OagzxWG+bX7Ek6VouygUwjtA@mail.gmail.com \
    --to=souravpanda@google.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=bhelgaas@google.com \
    --cc=chenlinxuan@uniontech.com \
    --cc=corbet@lwn.net \
    --cc=david@redhat.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=ivan@cloudflare.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mike.kravetz@oracle.com \
    --cc=muchun.song@linux.dev \
    --cc=pasha.tatashin@soleen.com \
    --cc=rafael@kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=rppt@kernel.org \
    --cc=shakeelb@google.com \
    --cc=surenb@google.com \
    --cc=tomas.mudrunka@gmail.com \
    --cc=vbabka@suse.cz \
    --cc=wangkefeng.wang@huawei.com \
    --cc=weixugc@google.com \
    --cc=willy@infradead.org \
    --cc=yang.yang29@zte.com.cn \
    --cc=yosryahmed@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox