Re: [PATCH 1/2] mm/damon/sysfs: Implement recording feature

From: SeongJae Park

Date: Sun Mar 15 2026 - 17:14:43 EST


Hello Cuiyangpei,

On Fri, 1 Dec 2023 20:25:07 +0800 cuiyangpei <cuiyangpei@xxxxxxxxx> wrote:

> On Thu, Nov 30, 2023 at 07:44:20PM +0000, SeongJae Park wrote:
> > Hi Cuiyangpei,
> >
> > On Thu, 30 Nov 2023 17:14:26 +0800 cuiyangpei <cuiyangpei@xxxxxxxxx> wrote:
> >
> > > Hi SeongJae,
> > >
> > > We also investigated the operation schemes you mentioned, but we don't
> > > think it can fit our needs.
> > >
> > > On android, user will open many apps and switch between these apps as
> > > needs. We hope to monitor apps' memory access only when they are on
> > > foreground and record the memory access pattern when they are switched
> > > to the background.
> > >
> > > When avaliable memory reaches a threshold, we will use these access
> > > patterns with some strategies to recognize those memory that will have
> > > little impact on user experience and to reclaim them proactively.
> > >
> > > I'm not sure I have clarified it clearly, if you still have questions
> > > on this, please let us know.
> >
> > So, to my understanding, you expect applications may keep similar access
> > pattern when they are in foreground, but have a different, less aggressive
> > access pattern in background, and therefore reclaim memory based on the
> > foreground-access pattern, right?
> >
>
> Different apps may have different access pattern. On android, the apps will
> join in freeze cgroup and be frozen after switch to the background. So we
> monitor apps' memory access only when they are in foreground.

FYI, I just posted an RFC patch that might help this use case. Hopefully the
cover letter will explain why I think so. If you need any clarifications or
have questions, please reply to the RFC patch series thread.

[1] https://lore.kernel.org/20260315210012.94846-1-sj@xxxxxxxxxx


Thanks,
SJ

[...]