[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1590578669-27408-1-git-send-email-foersleo@amazon.com>
Date: Wed, 27 May 2020 13:24:29 +0200
From: Leonard Foerster <foersleo@...zon.com>
To: SeongJae Park <sjpark@...zon.com>
Cc: akpm@...ux-foundation.org, SeongJae Park <sjpark@...zon.de>,
Jonathan.Cameron@...wei.com, aarcange@...hat.com, acme@...nel.org,
alexander.shishkin@...ux.intel.com, amit@...nel.org,
benh@...nel.crashing.org, brendan.d.gregg@...il.com,
brendanhiggins@...gle.com, cai@....pw, colin.king@...onical.com,
corbet@....net, dwmw@...zon.com, irogers@...gle.com,
jolsa@...hat.com, kirill@...temov.name, mark.rutland@....com,
mgorman@...e.de, minchan@...nel.org, mingo@...hat.com,
namhyung@...nel.org, peterz@...radead.org, rdunlap@...radead.org,
riel@...riel.com, rientjes@...gle.com, rostedt@...dmis.org,
sblbir@...zon.com, shakeelb@...gle.com, shuah@...nel.org,
sj38.park@...il.com, snu@...zon.de, vbabka@...e.cz,
vdavydov.dev@...il.com, yang.shi@...ux.alibaba.com,
ying.huang@...el.com, linux-damon@...zon.com, linux-mm@...ck.org,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v13 09/15] mm/damon: Add debugfs interface
On 2020-05-25T11:15:06+02:00 SeongJae Park <sjpark@...zon.com> wrote:
> From: SeongJae Park <sjpark@...zon.de>
>
> This commit adds a debugfs interface for DAMON.
>
> DAMON exports four files, ``attrs``, ``pids``, ``record``, and
> ``monitor_on`` under its debugfs directory, ``<debugfs>/damon/``.
>
> Attributes
> ----------
>
> Users can read and write the ``sampling interval``, ``aggregation
> interval``, ``regions update interval``, and min/max number of
> monitoring target regions by reading from and writing to the ``attrs``
> file. For example, below commands set those values to 5 ms, 100 ms,
> 1,000 ms, 10, 1000 and check it again::
>
> # cd <debugfs>/damon
> # echo 5000 100000 1000000 10 1000 > attrs
> # cat attrs
> 5000 100000 1000000 10 1000
>
> Target PIDs
> -----------
>
> Users can read and write the pids of current monitoring target processes
> by reading from and writing to the ``pids`` file. For example, below
> commands set processes having pids 42 and 4242 as the processes to be
> monitored and check it again::
>
> # cd <debugfs>/damon
> # echo 42 4242 > pids
> # cat pids
> 42 4242
>
> Note that setting the pids doesn't start the monitoring.
>
> Record
> ------
>
> DAMON supports direct monitoring result record feature. The recorded
> results are first written to a buffer and flushed to a file in batch.
> Users can set the size of the buffer and the path to the result file by
> reading from and writing to the ``record`` file. For example, below
> commands set the buffer to be 4 KiB and the result to be saved in
> '/damon.data'.
>
> # cd <debugfs>/damon
> # echo 4096 /damon.data > pids
> # cat record
> 4096 /damon.data
>
> Turning On/Off
> --------------
>
> You can check current status, start and stop the monitoring by reading
> from and writing to the ``monitor_on`` file. Writing ``on`` to the file
> starts DAMON to monitor the target processes with the attributes.
> Writing ``off`` to the file stops DAMON. DAMON also stops if every
> target processes is terminated. Below example commands turn on, off,
> and check status of DAMON::
>
> # cd <debugfs>/damon
> # echo on > monitor_on
> # echo off > monitor_on
> # cat monitor_on
> off
>
> Please note that you cannot write to the ``attrs`` and ``pids`` files
> while the monitoring is turned on. If you write to the files while
> DAMON is running, ``-EINVAL`` will be returned.
>
> Signed-off-by: SeongJae Park <sjpark@...zon.de>
> ---
Reviewed-by: Leonard Foerster <foersleo@...zon.de>
Powered by blists - more mailing lists