linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: sj@kernel.org
To: Barry Song <21cnbao@gmail.com>
Cc: sj@kernel.org, "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>,
	linux-damon@amazon.com
Subject: Re: DAMON VA regions don't split on an large Android APP
Date: Thu, 28 Apr 2022 16:16:44 +0000	[thread overview]
Message-ID: <20220428161644.84921-1-sj@kernel.org> (raw)
In-Reply-To: <CAGsJ_4y==XhrG9mNnLV_s1UovpsUsHGjTAvEK-XDJTy_L7AvDA@mail.gmail.com>

On Thu, 28 Apr 2022 13:27:59 +1200 Barry Song <21cnbao@gmail.com> wrote:

[...]
> 
> Thanks for the clarification.
> 
> i hardcoded min_nr_regions to 200 by:
> diff --git a/_damon.py b/_damon.py
> index 1306ea1..82342a5 100644
> --- a/_damon.py
> +++ b/_damon.py
> @@ -344,7 +344,7 @@ def set_attrs_argparser(parser):
>      parser.add_argument('-u', '--updr', metavar='<interval>', type=int,
>              default=1000000, help='regions update interval (us)')
>      parser.add_argument('-n', '--minr', metavar='<# regions>', type=int,
> -            default=10, help='minimal number of regions')
> +            default=200, help='minimal number of regions')
>      parser.add_argument('-m', '--maxr', metavar='<# regions>', type=int,
>              default=1000, help='maximum number of regions')
> 
> 
> Now wss seems to make more senses:
> 
> ~/damo # ./damo monitor --report_type=wss --count=20 2551
> # <percentile> <wss>
> # target_id 0
> # avr: 235.394 MiB
>   0             0 B |
>          |
>  25       2.164 MiB |
>          |
>  50     129.875 MiB |*********
>          |
>  75     430.547 MiB |******************************
>          |
> 100     844.238 MiB
> |***********************************************************|
> 
> # <percentile> <wss>
> # target_id 0
> # avr: 352.501 MiB
>   0       8.781 MiB |
[...]
>          |
> 100     664.480 MiB
> |***********************************************************|
> 
> Regions are like:
> 
> monitoring_start:             2.250 s
> monitoring_end:               2.350 s
> monitoring_duration:       100.425 ms
> target_id: 0
> nr_regions: 488
> 000012c00000-00002c14a000( 405.289 MiB): 0
> 00002c14a000-000044f05000( 397.730 MiB): 0
> 000044f05000-00005d106000( 386.004 MiB): 0
> 00005d106000-0000765f9000( 404.949 MiB): 0
> 0000765f9000-0000867b8000( 257.746 MiB): 0
> 0000867b8000-00009fb18000( 403.375 MiB): 0
[...]
> 007f74a66000-007f8caaf000( 384.285 MiB): 0
> 007f8caaf000-007fa423b000( 375.547 MiB): 0
> 007fa423b000-007fb9fb6000( 349.480 MiB): 0
> 007fb9fb6000-007fd29ae000( 393.969 MiB): 0
> 007fd29ae000-007fdbd6e000( 147.750 MiB): 0
> 
> Though I am not quite sure if it is accurate enough :-) so fixed-gran would be
> a nice feature.

Totally agreed.  Thank you for making your voice!  I will use this for
re-prioritizing my TODO list items.

[...]
> > >
> > > And I have a question, what do percentile 0,25,50,75 mean here?
> > > Why are they so different with percentile 100?
> > > For example, 0,25,50,75 has only KiB but 100 has GiB.
> >
> > For each aggregation interval, we get one snapshot.  So, if we have a
> > monitoring results that recorded for, say, 100 aggregation interval, we have
> > 100 snapshots.  'damo' calculates working set size of each snapshot by summing
> > size of regions assumed to be accessed at least once.  So, in this example, we
> > get 100 wss values.  Then, 'damo' sorts the values and provides the smallest
> > one as 0-th percentile, 25th small value as 25-th percentile, and so on.
> >
> > 100-th percentile wss is usually noisy, as DAMON regions shouldn't be converged
> > well at the beginning of the record.  I believe that could be the reason why
> > the 100-th percentile wss is so unexpectedly big.
> >
> > I personally use 50-th percentile as reliable value.
> 
> Thanks, it seems you mean if we get 100 snapshots with values exactly as
> 2, 4, 6, 8, 10..... , 198, 200 (just an example)
> 
> for 25%, we will get 50; for 50%, we will get 100; for 75%, we will
> get 150, for 100%,
> we will get 200. Right?

You're perfectly understanding my point.

> 
> I am not quite sure I understand "as DAMON regions shouldn't be converged well
> at the beginning of the record", in case we are monitoring with
> --count=2000, I suppose
> only at the beginning, regions are not splitted very well? When we
> have run monitor
> for a while, regions should have been relatively stable? I mean I
> don't quite understand
> why 100% is noise and 50% is more reliable.

'damo monitor' simply repeats 'damo record' and 'damo report'.  That is, it
starts recording, stop recording, reporting, and repeat.  Therefore every 'damo
moitor' results are fresh ones, not a snapshot of ongoing record.  Therefore
regions converge from the beginning for every 'damo monitor' output.  Sorry for
the ugly implementation.  It should be improved in a near future.


Thanks,
SJ

[...]


  reply	other threads:[~2022-04-28 16:16 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 [this message]
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
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=20220428161644.84921-1-sj@kernel.org \
    --to=sj@kernel.org \
    --cc=21cnbao@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=brendanhiggins@google.com \
    --cc=foersleo@amazon.de \
    --cc=linux-damon@amazon.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lipeifeng@oppo.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=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).