linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Michal Hocko <mhocko@suse.com>
Cc: Wenchao Hao <haowenchao22@gmail.com>,
	Kiryl Shutsemau <kirill@shutemov.name>,
	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>,
	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 18:17:00 +0100	[thread overview]
Message-ID: <05031b51-9c77-4bfb-ba03-68d1cf7c31b3@kernel.org> (raw)
In-Reply-To: <aZNPhm954AqQQ3Q3@tiehlicka>

On 2/16/26 18:10, Michal Hocko wrote:
> On Mon 16-02-26 17:56:12, David Hildenbrand wrote:
>> On 2/16/26 17:42, Michal Hocko wrote:
>>>
>>> You are comparing content of all anon pages, aren't you? Depending on
>>> the content this can add a lot of overhead.
>>>
>>>
>>> MADV_GET_ZEROPAGE would make more sense to me. But a more fundamental
>>> question is whether this metric is really what you want long term.
>>> Kernel can do all sorts of optimizations behind userspace back - e.g.
>>> map shared zero page - so just learning that a process has a lot of
>>> pages filled up with zeroes doesn't tell you all that much. Or does it?
>>
>> If a sysadmin wants to see where THP hurt (zero-filled pages), surely
>> MADV_GET_ZEROPAGE is the wrong (ugly) interface.
> 
> The question is whether sysadmin should really ask questions like that.
> Without a deeper understanding of the workload the answer could be
> misleading at best, no matter what interface is available.

Given the requests for per-process control of THPs I assume some 
sysadmins (at hyperscalers :) ) really care about the relevant processes 
and even the relevant memory areas (e.g., jmalloc area).

> 
> If you know and understand the workload you already know that THP is not
> a good fit and you do not need to ask about that. If you want to
> understand whether your particular workload has a big internal
> fragmentation due to THPs then MADV_GET_ZEROPAGE sounds like a
> reasonable fit to me.

You could also just scan the pages yourself for 0-content, or what's the 
benefit of letting the kernel do that?

> 
>  From a sysadmin POV you care about the overall memory consuption, right?

I'm not so sure about that.

-- 
Cheers,

David


  reply	other threads:[~2026-02-16 17:17 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) [this message]
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
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=05031b51-9c77-4bfb-ba03-68d1cf7c31b3@kernel.org \
    --to=david@kernel.org \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=haowenchao22@gmail.com \
    --cc=kirill@shutemov.name \
    --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 \
    /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