linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Wenchao Hao <haowenchao22@gmail.com>
To: "David Hildenbrand (Arm)" <david@kernel.org>
Cc: 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: [RFC PATCH] mm: only set fault addrsss' access bit in do_anonymous_page
Date: Fri, 13 Feb 2026 22:52:28 +0800	[thread overview]
Message-ID: <CAOptpSPuWb7u+ONYAeqsAOCkheqg5oGW23ARc9D41mnHDAXajA@mail.gmail.com> (raw)
In-Reply-To: <f5f0f666-b9e5-48a1-8e4b-e7647e4103f6@kernel.org>

On Fri, Feb 13, 2026 at 5:08 PM David Hildenbrand (Arm)
<david@kernel.org> wrote:
>
> On 2/13/26 10:02, Wenchao Hao wrote:
> > On Thu, Feb 12, 2026 at 4:54 PM David Hildenbrand (Arm)
> > <david@kernel.org> wrote:
> >>
> >> On 2/12/26 02:57, Wenchao Hao wrote:
> >>> On Wed, Feb 11, 2026 at 5:05 PM David Hildenbrand (Arm)
> >>> <david@kernel.org> wrote:
> >>>
> >>> Thanks for your explanation. I now understand the design logic.
> >>>
> >>> What I’m proposing is mainly for debugging. After enabling 64K large folio
> >>> on Android, we observed increased application memory footprint, especially
> >>> for anonymous pages.
> >>>
> >>> Since Android app memory usage depends on runtime scenarios, we cannot
> >>> confirm if the growth is directly caused by large folio. We want to
> >>> analyze memory
> >>> usage via the `Referenced` field in `/proc/[pid]/smaps`.
> >>
> >> Scanning for zero-filled pages will be much easier and more reliable.
> >> For a debug feature good enough.
> >>
> >> I'm wondering what the best interface for something like that could be:
> >> we don't want to make "/proc/[pid]/smaps" slower for all users.
> >>
> >> Maybe we could for debug kernels.
> >>
> >> For example, adding with CONFIG_DEBUG_KERNEL a new entry
> >>
> >>          Anon_Zero:
> >>
> >> counter that just tests whether the page content of an anonymous page is
> >> all zeroes could be doable.
> >>
> >
> > Apologies for the delayed reply – I was just writing a demo to verify the
> > approach you mentioned.
> >
> > Using the CONFIG_DEBUG_KERNEL compile-time macro to isolate this feature
> > is indeed an excellent idea.
> >
> > However, in engineering practice, it requires recompiling and
> > replacing the kernel,
> > which can be cumbersome. Could we instead use a dynamic switch to control
> > whether scan for zero-filled pages when reading /proc/[pid]/smaps?
>
> Maybe a kernel cmdline option could do?
Kernel command line parameters can meet our requirements.

> Selectively enabling it for some PIDs only is not really possible, but also, maybe it's not really needed.
Yes, it is unnecessary to do that.

By the way, will you send a new patch for this, or shall I take care of it?
Thanks.
>
> --
> Cheers,
>
> David


  reply	other threads:[~2026-02-13 14:52 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-10  4:34 Wenchao Hao
2026-02-10  9:07 ` David Hildenbrand (Arm)
2026-02-11  0:49   ` Wenchao Hao
2026-02-11  4:18     ` Dev Jain
2026-02-12  1:42       ` Wenchao Hao
2026-02-12  5:04         ` Dev Jain
2026-02-11  9:05     ` David Hildenbrand (Arm)
2026-02-12  1:57       ` Wenchao Hao
2026-02-12  8:54         ` David Hildenbrand (Arm)
2026-02-13  9:02           ` Wenchao Hao
2026-02-13  9:07             ` David Hildenbrand (Arm)
2026-02-13 14:52               ` Wenchao Hao [this message]
2026-02-13 15:08                 ` David Hildenbrand (Arm)
2026-02-10 11:56 ` Kiryl Shutsemau
2026-02-11  1:00   ` Wenchao Hao
2026-02-11 11:03     ` Kiryl Shutsemau
2026-02-12  2:08       ` 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=CAOptpSPuWb7u+ONYAeqsAOCkheqg5oGW23ARc9D41mnHDAXajA@mail.gmail.com \
    --to=haowenchao22@gmail.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@kernel.org \
    --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