linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Kiryl Shutsemau <kirill@shutemov.name>
To: Matthew Wilcox <willy@infradead.org>
Cc: Wenchao Hao <haowenchao22@gmail.com>,
	 "David Hildenbrand (Arm)" <david@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	 Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
	"Liam R . Howlett" <Liam.Howlett@oracle.com>,
	 Vlastimil Babka <vbabka@suse.cz>,
	Mike Rapoport <rppt@kernel.org>,
	 Suren Baghdasaryan <surenb@google.com>,
	Michal Hocko <mhocko@suse.com>,
	linux-mm@kvack.org,  linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: Add AnonZero accounting for zero-filled anonymous pages
Date: Mon, 16 Feb 2026 17:18:04 +0000	[thread overview]
Message-ID: <aZNPE1D2oj-AvO9a@thinkstation> (raw)
In-Reply-To: <aZNNf_OkH-4DXDR0@casper.infradead.org>

On Mon, Feb 16, 2026 at 05:01:51PM +0000, Matthew Wilcox wrote:
> On Mon, Feb 16, 2026 at 04:54:05PM +0000, Kiryl Shutsemau wrote:
> > What I would like to see in the kernel is a syscall that return the
> > memory stats in binary form. Something like
> > 
> > size_t memstat(int pidfd, struct memstat memstatbuf[], size_t n,
> > 		unsigned long flags, unsigned long start, unsigned long end);
> > 
> > The syscall will fill up to n memstatbufs, one per-VMA. What exactly
> > filled there defined by flags. The return value is how many memstatbuf
> > is populated. The caller can call it multiple times to walk address
> > space it is interested in.
> > 
> > We also can have a flag that mirrors smaps_rollup behaviour and collect
> > all the data into a single memstatbuf.
> 
> But is that what we want?  Let's say a process allocates a 2MB THP, uses
> 12kB of it and then forks.  A lot.  Now all children that haven't called
> exec() see the wasted 2036kB.  Would we rather have something that scans
> (say) the LRU list looking for zero memory?

Are describing THP shrinker? :)

I don't particular care about original poster use-case. I want to see
more scalable way to access memory statistic information in general.
smaps is slow, because it collects information user doesn't care about.

-- 
  Kiryl Shutsemau / Kirill A. Shutemov


  parent reply	other threads:[~2026-02-16 17:18 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-14  8:45 Wenchao Hao
2026-02-16 11:34 ` Kiryl Shutsemau
2026-02-16 11:45   ` David Hildenbrand (Arm)
2026-02-16 11:58     ` Kiryl Shutsemau
2026-02-16 12:19       ` David Hildenbrand (Arm)
2026-02-16 15:59       ` Wenchao Hao
2026-02-16 16:42         ` Michal Hocko
2026-02-16 16:56           ` David Hildenbrand (Arm)
2026-02-16 17:10             ` Michal Hocko
2026-02-16 17:17               ` David Hildenbrand (Arm)
2026-02-16 16:54         ` Kiryl Shutsemau
2026-02-16 17:01           ` Matthew Wilcox
2026-02-16 17:10             ` David Hildenbrand (Arm)
2026-02-16 17:18             ` Kiryl Shutsemau [this message]
2026-02-16 12:15 ` David Hildenbrand (Arm)
2026-02-16 15:10   ` Wenchao Hao
2026-02-16 15:18     ` David Hildenbrand (Arm)
2026-02-16 14:22 ` Matthew Wilcox
2026-02-16 15:55   ` Wenchao Hao
2026-02-16 17:03 ` Matthew Wilcox
2026-02-17 15:22 ` Wenchao Hao
2026-02-17 20:29   ` David Hildenbrand (Arm)
2026-02-17 21:53     ` Kiryl Shutsemau
2026-02-19  2:11       ` Wenchao Hao
2026-02-18  7:52   ` Michal Hocko
2026-02-19  2:47     ` Wenchao Hao

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=aZNPE1D2oj-AvO9a@thinkstation \
    --to=kirill@shutemov.name \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@kernel.org \
    --cc=haowenchao22@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=mhocko@suse.com \
    --cc=rppt@kernel.org \
    --cc=surenb@google.com \
    --cc=vbabka@suse.cz \
    --cc=willy@infradead.org \
    /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