Linux-mm Archive on lore.kernel.org
 help / color / Atom feed
From: SeongJae Park <sjpark@amazon.com>
To: <akpm@linux-foundation.org>
Cc: SeongJae Park <sjpark@amazon.de>, <Jonathan.Cameron@Huawei.com>,
	<aarcange@redhat.com>, <acme@kernel.org>,
	<alexander.shishkin@linux.intel.com>, <amit@kernel.org>,
	<benh@kernel.crashing.org>, <brendan.d.gregg@gmail.com>,
	<brendanhiggins@google.com>, <cai@lca.pw>,
	<colin.king@canonical.com>, <corbet@lwn.net>, <dwmw@amazon.com>,
	<foersleo@amazon.de>, <irogers@google.com>, <jolsa@redhat.com>,
	<kirill@shutemov.name>, <mark.rutland@arm.com>, <mgorman@suse.de>,
	<minchan@kernel.org>, <mingo@redhat.com>, <namhyung@kernel.org>,
	<peterz@infradead.org>, <rdunlap@infradead.org>,
	<riel@surriel.com>, <rientjes@google.com>, <rostedt@goodmis.org>,
	<sblbir@amazon.com>, <shakeelb@google.com>, <shuah@kernel.org>,
	<sj38.park@gmail.com>, <snu@amazon.de>, <vbabka@suse.cz>,
	<vdavydov.dev@gmail.com>, <yang.shi@linux.alibaba.com>,
	<ying.huang@intel.com>, <david@redhat.com>,
	<linux-damon@amazon.com>, <linux-mm@kvack.org>,
	<linux-doc@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: [PATCH v17 11/15] tools/damon/wss: Implement '--thres' option
Date: Mon, 6 Jul 2020 13:53:18 +0200
Message-ID: <20200706115322.29598-12-sjpark@amazon.com> (raw)
In-Reply-To: <20200706115322.29598-1-sjpark@amazon.com>

From: SeongJae Park <sjpark@amazon.de>

Currently, 'wss' treats every region as working set if accessed at least
once.  Someone who want to know performance important working set only
would want to ignore regions having low access frequency.  '--thres'
option can be used to set the minimal access frequency of the regions to
be classified as the workingset.

Using this, users can plot the reuse histogram.  For example:

    $ damo record $(pidof raytrace)
    $ for t in {1..20}; do ./tools/damon/damo report wss --thres $t | \
    		grep avr | awk -v reuse_time=$(( (21 - t) * 5 )) \
    		'{print reuse_time " " $3}'; done
    100 12838416
    95 2222623
    90 1585480
    85 422890
    80 67040
    75 45218
    70 13242
    65 12896
    60 12136
    55 10872
    50 9648
    45 8136
    40 7052
    35 6304
    30 5736
    25 5404
    20 5305
    15 5187
    10 5069
    5 4873

Above command shows the reuse histogram of parsec3.raytrace.  Remind
that the sampling interval and aggregation interval are 5ms and 100ms
by default and this command used the default values.  So, the above
output means that about 12MB of memory region was reused within 100 ms
while only about 2MB of memory region was reused within 95 ms, then
about 1.5MB within 90ms, and so on, in average.

Signed-off-by: SeongJae Park <sjpark@amazon.de>
---
 tools/damon/wss.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/damon/wss.py b/tools/damon/wss.py
index b43065176cfd..d2a1b149e3ea 100644
--- a/tools/damon/wss.py
+++ b/tools/damon/wss.py
@@ -17,6 +17,8 @@ def set_argparser(parser):
     parser.add_argument('--range', '-r', type=int, nargs=3,
             metavar=('<start>', '<stop>', '<step>'),
             help='range of wss percentiles to print')
+    parser.add_argument('--thres', '-t', type=int, metavar='<# accesses>',
+            help='minimal number of accesses for treated as working set')
     parser.add_argument('--sortby', '-s', choices=['time', 'size'],
             help='the metric to be used for the sort of the working set sizes')
     parser.add_argument('--plot', '-p', type=str, metavar='<file>',
@@ -67,7 +69,7 @@ def main(args=None):
             wss = 0
             for p in snapshot:
                 # Ignore regions not accessed
-                if p[1] <= 0:
+                if p[1] < args.thres:
                     continue
                 wss += p[0]
             wss_dist.append(wss)
-- 
2.17.1



  parent reply index

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-06 11:53 [PATCH v17 00/15] Introduce Data Access MONitor (DAMON) SeongJae Park
2020-07-06 11:53 ` [PATCH v17 01/15] mm/page_ext: Export lookup_page_ext() to GPL modules SeongJae Park
2020-07-06 11:53 ` [PATCH v17 02/15] mm: Introduce Data Access MONitor (DAMON) SeongJae Park
2020-07-06 11:53 ` [PATCH v17 03/15] mm/damon: Implement region based sampling SeongJae Park
2020-07-07  7:54   ` SeongJae Park
2020-07-06 11:53 ` [PATCH v17 04/15] mm/damon: Adaptively adjust regions SeongJae Park
2020-07-06 11:53 ` [PATCH v17 05/15] mm/damon: Track dynamic monitoring target regions update SeongJae Park
2020-07-06 11:53 ` [PATCH v17 06/15] mm/damon: Implement callbacks for the virtual memory address spaces SeongJae Park
2020-07-06 11:53 ` [PATCH v17 07/15] mm/damon: Implement access pattern recording SeongJae Park
2020-07-06 11:53 ` [PATCH v17 08/15] mm/damon: Add a tracepoint SeongJae Park
2020-07-06 11:53 ` [PATCH v17 09/15] mm/damon: Implement a debugfs interface SeongJae Park
2020-07-06 11:53 ` [PATCH v17 10/15] tools: Introduce a minimal user-space tool for DAMON SeongJae Park
2020-07-06 11:53 ` SeongJae Park [this message]
2020-07-06 15:04   ` [PATCH v17 11/15] tools/damon/wss: Implement '--thres' option SeongJae Park
2020-07-06 11:53 ` [PATCH v17 12/15] Documentation/admin-guide/mm: Add a document for DAMON SeongJae Park
2020-07-07  7:49   ` Mike Rapoport
2020-07-07  8:07     ` SeongJae Park
2020-07-06 11:53 ` [PATCH v17 13/15] mm/damon: Add kunit tests SeongJae Park
2020-07-06 11:53 ` [PATCH v17 14/15] mm/damon: Add user space selftests SeongJae Park
2020-07-06 11:53 ` [PATCH v17 15/15] MAINTAINERS: Update for DAMON SeongJae Park

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=20200706115322.29598-12-sjpark@amazon.com \
    --to=sjpark@amazon.com \
    --cc=Jonathan.Cameron@Huawei.com \
    --cc=aarcange@redhat.com \
    --cc=acme@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=amit@kernel.org \
    --cc=benh@kernel.crashing.org \
    --cc=brendan.d.gregg@gmail.com \
    --cc=brendanhiggins@google.com \
    --cc=cai@lca.pw \
    --cc=colin.king@canonical.com \
    --cc=corbet@lwn.net \
    --cc=david@redhat.com \
    --cc=dwmw@amazon.com \
    --cc=foersleo@amazon.de \
    --cc=irogers@google.com \
    --cc=jolsa@redhat.com \
    --cc=kirill@shutemov.name \
    --cc=linux-damon@amazon.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mark.rutland@arm.com \
    --cc=mgorman@suse.de \
    --cc=minchan@kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rdunlap@infradead.org \
    --cc=riel@surriel.com \
    --cc=rientjes@google.com \
    --cc=rostedt@goodmis.org \
    --cc=sblbir@amazon.com \
    --cc=shakeelb@google.com \
    --cc=shuah@kernel.org \
    --cc=sj38.park@gmail.com \
    --cc=sjpark@amazon.de \
    --cc=snu@amazon.de \
    --cc=vbabka@suse.cz \
    --cc=vdavydov.dev@gmail.com \
    --cc=yang.shi@linux.alibaba.com \
    --cc=ying.huang@intel.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

Linux-mm Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-mm/0 linux-mm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-mm linux-mm/ https://lore.kernel.org/linux-mm \
		linux-mm@kvack.org
	public-inbox-index linux-mm

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kvack.linux-mm


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git