From: SeongJae Park <sj@kernel.org>
To: sj@kernel.org
Cc: "Barry Song" <21cnbao@gmail.com>,
"Rongwei Wang" <rongwei.wang@linux.alibaba.com>,
"Andrew Morton" <akpm@linux-foundation.org>,
Linux-MM <linux-mm@kvack.org>,
LKML <linux-kernel@vger.kernel.org>,
"Matthew Wilcox" <willy@infradead.org>,
shuah@kernel.org, brendanhiggins@google.com, foersleo@amazon.de,
sieberf@amazon.com, "Shakeel Butt" <shakeelb@google.com>,
sjpark@amazon.de, tuhailong@gmail.com,
"Song Jiang" <sjiang88@gmail.com>,
"张诗明(Simon Zhang)" <zhangshiming@oppo.com>,
"李培锋(wink)" <lipeifeng@oppo.com>,
xhao@linux.alibaba.com, damon@lists.linux.dev
Subject: Re: DAMON VA regions don't split on an large Android APP
Date: Sun, 29 May 2022 19:54:11 +0000 [thread overview]
Message-ID: <20220529195411.102379-1-sj@kernel.org> (raw)
In-Reply-To: <20220427175049.50057-1-sj@kernel.org>
On Wed, 27 Apr 2022 17:50:49 +0000 sj@kernel.org wrote:
> Hello Rongwei and Barry,
>
> On Wed, 27 Apr 2022 19:44:23 +1200 Barry Song <21cnbao@gmail.com> wrote:
>
> > On Wed, Apr 27, 2022 at 6:56 PM Rongwei Wang
> > <rongwei.wang@linux.alibaba.com> wrote:
> > >
> > >
> > >
> > > On 4/27/22 7:19 AM, Barry Song wrote:
[...]
> >
> > I guess the cause might be:
> > in case a region is very big like 10GiB, we have only 1MiB hot pages
> > in this large region.
> > damon will randomly pick one page to sample, but the page has only
> > 1MiB/10GiB, thus
> > less than 1/10000 chance to hit the hot 1MiB. so probably we need
> > 10000 sample periods
> > to hit the hot 1MiB in order to split this large region?
> >
> > @SeongJae, please correct me if I am wrong.
>
> I think your theory makes sense. There was a similar concern, so we made DAMON
> to split regions into 3 sub-regions when we don't see advance[1]. My current
> rough idea for improving DAMON accuracy is making it more aggressive while
> keeping the monitoring overhead low.
>
> [1] https://git.kernel.org/pub/scm/linux/kernel/git/sj/linux.git/tree/mm/damon/core.c?h=damon/next-2022-04-21-08-31-on-v5.18-rc3-mmots-2022-04-20-17-37#n1053
>
> >
> > >
> > > I'm not sure whether sets init_regions can deal with the above problem,
> > > or dynamic choose one or limited number VMA to monitor.
> > >
> >
> > I won't set a limited number of VMA as this will make the damon too hard to use
> > as nobody wants to make such complex operations, especially an Android
> > app might have more than 8000 VMAs.
> >
> > I agree init_regions might be the right place to enhance the situation.
>
> 'init_regions' has developed for the purpose, where user space knows some good
> information for starting point of the regions adjustment, and thus want to hint
> DAMON. Nevertheless, it might not work as expected, because DAMON
> automatically updates the target regions to cover all VMAs as much as it can.
> I have posted a patchset for the use case yesterday[1].
>
> [1] https://lore.kernel.org/linux-mm/20220426231750.48822-1-sj@kernel.org/
FWIW, the patchset for the fixed virtual address space ranges monitoring has
merged in the mainline[1].
[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=98931dd95fd489fcbfa97da563505a6f071d7c77
Thanks,
SJ
[...]
next prev parent reply other threads:[~2022-05-29 19:54 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-26 23:19 DAMON VA regions don't split on an large Android APP Barry Song
2022-04-27 0:21 ` sj
2022-04-27 2:08 ` Barry Song
2022-04-27 17:39 ` sj
2022-04-28 1:27 ` Barry Song
2022-04-28 16:16 ` sj
2022-04-27 6:56 ` Rongwei Wang
2022-04-27 7:44 ` Barry Song
2022-04-27 9:22 ` Barry Song
2022-04-27 11:55 ` Rongwei Wang
2022-04-28 2:04 ` Rongwei Wang
2022-04-28 7:37 ` Barry Song
2022-04-28 11:19 ` Rongwei Wang
2022-05-16 7:03 ` Barry Song
2022-05-16 15:00 ` Rongwei Wang
2022-05-17 11:14 ` Barry Song
2022-05-18 3:03 ` Rongwei Wang
2022-05-18 9:51 ` Barry Song
2022-05-19 3:09 ` Rongwei Wang
2022-04-27 12:06 ` Rongwei Wang
2022-04-27 17:50 ` sj
2022-05-29 19:54 ` SeongJae Park [this message]
2022-05-30 5:04 ` Barry Song
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=20220529195411.102379-1-sj@kernel.org \
--to=sj@kernel.org \
--cc=21cnbao@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=brendanhiggins@google.com \
--cc=damon@lists.linux.dev \
--cc=foersleo@amazon.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lipeifeng@oppo.com \
--cc=rongwei.wang@linux.alibaba.com \
--cc=shakeelb@google.com \
--cc=shuah@kernel.org \
--cc=sieberf@amazon.com \
--cc=sjiang88@gmail.com \
--cc=sjpark@amazon.de \
--cc=tuhailong@gmail.com \
--cc=willy@infradead.org \
--cc=xhao@linux.alibaba.com \
--cc=zhangshiming@oppo.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;
as well as URLs for NNTP newsgroup(s).