Linux Documentation
 help / color / mirror / Atom feed
From: wangzicheng <wangzicheng@honor.com>
To: "T.J. Mercier" <tjmercier@google.com>
Cc: "akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"yuanchu@google.com" <yuanchu@google.com>,
	"tj@kernel.org" <tj@kernel.org>,
	"hannes@cmpxchg.org" <hannes@cmpxchg.org>,
	"mkoutny@suse.com" <mkoutny@suse.com>,
	"corbet@lwn.net" <corbet@lwn.net>,
	"kasong@tencent.com" <kasong@tencent.com>,
	"qi.zheng@linux.dev" <qi.zheng@linux.dev>,
	"shakeel.butt@linux.dev" <shakeel.butt@linux.dev>,
	"baohua@kernel.org" <baohua@kernel.org>,
	"axelrasmussen@google.com" <axelrasmussen@google.com>,
	"weixugc@google.com" <weixugc@google.com>,
	"david@kernel.org" <david@kernel.org>,
	"ljs@kernel.org" <ljs@kernel.org>,
	"liam@infradead.org" <liam@infradead.org>,
	"vbabka@kernel.org" <vbabka@kernel.org>,
	"rppt@kernel.org" <rppt@kernel.org>,
	"surenb@google.com" <surenb@google.com>,
	"mhocko@suse.com" <mhocko@suse.com>,
	"roman.gushchin@linux.dev" <roman.gushchin@linux.dev>,
	"muchun.song@linux.dev" <muchun.song@linux.dev>,
	"cgroups@vger.kernel.org" <cgroups@vger.kernel.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
	"willy@infradead.org" <willy@infradead.org>,
	denghaojie <denghaojie@honor.com>,
	"baoquan.he@linux.dev" <baoquan.he@linux.dev>,
	"kaleshsingh@google.com" <kaleshsingh@google.com>,
	wangtao <tao.wangtao@honor.com>, zhangji <zhangji1@honor.com>,
	wangzhen <wangzhen5@honor.com>
Subject: RE: [RFC v2 0/3] mm/mglru: proactive aging via memory.aging
Date: Thu, 16 Jul 2026 03:34:42 +0000	[thread overview]
Message-ID: <75116e612e8142f4ada1dfcc834ceb09@honor.com> (raw)
In-Reply-To: <CABdmKX3y841t4Oqg3RRHTGXWP-LMMSi_exDuxAc4jR9v9ChD2g@mail.gmail.com>

> On Tue, Jul 14, 2026 at 5:15 AM Zicheng Wang <wangzicheng@honor.com>
> wrote:
> > The benefit is workload-dependent: file-cache-bound servers gain from
> > aging, anon-bound servers do not, so no kernel default is correct for
> > all.  The kernel also cannot know when to age: on Android the right
> > moment is the foreground-to-background transition, when the app's pages
> > are cold but their PTE accessed bits are still accurate from foreground
> > execution, a framework concept.
> 
> When an app transitions and becomes cached, we attempt to reclaim its
> entire workingset. We basically cat memory.current > memory.reclaim
> and freeze the cgroup.
> https://cs.android.com/android/platform/superproject/+/android-latest-
> release:system/core/libprocessgroup/task_profiles.cpp;drc=65bd7ab941a70
> 9bf049871406981022b988e1721;l=706
> 
> File / anon balance vs hotness and generational placement doesn't
> matter in that scenario because we want to get rid of all of it. So I
> don't really understand how you'd want to use an aging knob.

Hi T.J.,

Thanks for the reference.

We know Android reclaims the entire workingset and freezes the cgroup
on backgrounding (we discussed this at LSF/MM/BPF 2026, if I recall).
We are concerned about performance: that means a subsequent hot start
has to re-fault the whole set, which may increase IO, CPU, and power
cost. We would prefer a reclaim ratio tuned per SoC, trading memory
headroom against hot-start latency.

Proactive aging is what makes that workable: age first so anonymous
pages become reclaimable, then reclaim them while retaining the file
cache.

fg->bg is a simple and effective heuristic. Proactive aging is useful
beyond it: on file-cache-bound servers (fio random-read +31.8% in our
measurements), and likely in other Android scenarios we have not yet
explored.
  
Best,
Zicheng

      parent reply	other threads:[~2026-07-16  3:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-14 12:15 [RFC v2 0/3] mm/mglru: proactive aging via memory.aging Zicheng Wang
2026-07-14 12:15 ` [RFC v2 1/3] mm/lru_gen: add AGING counter and proactive aging helper Zicheng Wang
2026-07-14 12:15 ` [RFC v2 2/3] mm: memcontrol: add memory.aging cgroup v2 file Zicheng Wang
2026-07-14 12:15 ` [RFC v2 3/3] mm/lru_gen: expose oldest-generation page counts in memory.stat Zicheng Wang
2026-07-15 14:00 ` [RFC v2 0/3] mm/mglru: proactive aging via memory.aging Johannes Weiner
2026-07-16  6:37   ` wangzicheng
2026-07-15 17:55 ` T.J. Mercier
2026-07-16  2:29   ` Ridong Chen
2026-07-16  3:49     ` wangzicheng
2026-07-16  3:34   ` wangzicheng [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=75116e612e8142f4ada1dfcc834ceb09@honor.com \
    --to=wangzicheng@honor.com \
    --cc=akpm@linux-foundation.org \
    --cc=axelrasmussen@google.com \
    --cc=baohua@kernel.org \
    --cc=baoquan.he@linux.dev \
    --cc=cgroups@vger.kernel.org \
    --cc=corbet@lwn.net \
    --cc=david@kernel.org \
    --cc=denghaojie@honor.com \
    --cc=hannes@cmpxchg.org \
    --cc=kaleshsingh@google.com \
    --cc=kasong@tencent.com \
    --cc=liam@infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=mhocko@suse.com \
    --cc=mkoutny@suse.com \
    --cc=muchun.song@linux.dev \
    --cc=qi.zheng@linux.dev \
    --cc=roman.gushchin@linux.dev \
    --cc=rppt@kernel.org \
    --cc=shakeel.butt@linux.dev \
    --cc=surenb@google.com \
    --cc=tao.wangtao@honor.com \
    --cc=tj@kernel.org \
    --cc=tjmercier@google.com \
    --cc=vbabka@kernel.org \
    --cc=wangzhen5@honor.com \
    --cc=weixugc@google.com \
    --cc=willy@infradead.org \
    --cc=yuanchu@google.com \
    --cc=zhangji1@honor.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