1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00

Docs/admin-guide/mm/damon/start: update snapshot example

Two of DAMON user-space tool (damo) commands that are used for examples on
DAMON getting started document, namely 'damo show' and 'damo report heats'
are deprecated[1,2], and replaced by new commands that provides same
functions with unified and simplified user interfaces.  Also the example
output of 'damo show' is outdated.  'damo schemes' command is not
deprecated, but users are recommended to use 'damo start' or 'damo tune'
instead.

Update the examples to use the replacements, recommendations, and
up-to-date output formats.

[1] https://git.kernel.org/sj/damo/c/3272e0ac94ecc5e1
[2] https://git.kernel.org/sj/damo/c/da3ec66bbdd9e87d

Link: https://lkml.kernel.org/r/20250110185232.54907-5-sj@kernel.org
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: Honggyu Kim <honggyu.kim@sk.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Yunjeong Mun <yunjeong.mun@sk.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
SeongJae Park 2025-01-10 10:52:31 -08:00 committed by Andrew Morton
parent eb14b12c8c
commit d24393450b

View file

@ -42,32 +42,45 @@ the execution. ::
$ git clone https://github.com/sjp38/masim; cd masim; make $ git clone https://github.com/sjp38/masim; cd masim; make
$ sudo damo start "./masim ./configs/stairs.cfg --quiet" $ sudo damo start "./masim ./configs/stairs.cfg --quiet"
$ sudo ./damo show $ sudo damo report access
0 addr [85.541 TiB , 85.541 TiB ) (57.707 MiB ) access 0 % age 10.400 s heatmap: 641111111000000000000000000000000000000000000000000000[...]33333333333333335557984444[...]7
1 addr [85.541 TiB , 85.542 TiB ) (413.285 MiB) access 0 % age 11.400 s # min/max temperatures: -1,840,000,000, 370,010,000, column size: 3.925 MiB
2 addr [127.649 TiB , 127.649 TiB) (57.500 MiB ) access 0 % age 1.600 s 0 addr 86.182 TiB size 8.000 KiB access 0 % age 14.900 s
3 addr [127.649 TiB , 127.649 TiB) (32.500 MiB ) access 0 % age 500 ms 1 addr 86.182 TiB size 8.000 KiB access 60 % age 0 ns
4 addr [127.649 TiB , 127.649 TiB) (9.535 MiB ) access 100 % age 300 ms 2 addr 86.182 TiB size 3.422 MiB access 0 % age 4.100 s
5 addr [127.649 TiB , 127.649 TiB) (8.000 KiB ) access 60 % age 0 ns 3 addr 86.182 TiB size 2.004 MiB access 95 % age 2.200 s
6 addr [127.649 TiB , 127.649 TiB) (6.926 MiB ) access 0 % age 1 s 4 addr 86.182 TiB size 29.688 MiB access 0 % age 14.100 s
7 addr [127.998 TiB , 127.998 TiB) (120.000 KiB) access 0 % age 11.100 s 5 addr 86.182 TiB size 29.516 MiB access 0 % age 16.700 s
8 addr [127.998 TiB , 127.998 TiB) (8.000 KiB ) access 40 % age 100 ms 6 addr 86.182 TiB size 29.633 MiB access 0 % age 17.900 s
9 addr [127.998 TiB , 127.998 TiB) (4.000 KiB ) access 0 % age 11 s 7 addr 86.182 TiB size 117.652 MiB access 0 % age 18.400 s
total size: 577.590 MiB 8 addr 126.990 TiB size 62.332 MiB access 0 % age 9.500 s
$ sudo ./damo stop 9 addr 126.990 TiB size 13.980 MiB access 0 % age 5.200 s
10 addr 126.990 TiB size 9.539 MiB access 100 % age 3.700 s
11 addr 126.990 TiB size 16.098 MiB access 0 % age 6.400 s
12 addr 127.987 TiB size 132.000 KiB access 0 % age 2.900 s
total size: 314.008 MiB
$ sudo damo stop
The first command of the above example downloads and builds an artificial The first command of the above example downloads and builds an artificial
memory access generator program called ``masim``. The second command asks DAMO memory access generator program called ``masim``. The second command asks DAMO
to execute the artificial generator process start via the given command and to start the program via the given command and make DAMON monitors the newly
make DAMON monitors the generator process. The third command retrieves the started process. The third command retrieves the current snapshot of the
current snapshot of the monitored access pattern of the process from DAMON and monitored access pattern of the process from DAMON and shows the pattern in a
shows the pattern in a human readable format. human readable format.
Each line of the output shows which virtual address range (``addr [XX, XX)``) The first line of the output shows the relative access temperature (hotness) of
of the process is how frequently (``access XX %``) accessed for how long time the regions in a single row hetmap format. Each column on the heatmap
(``age XX``). For example, the fifth region of ~9 MiB size is being most represents regions of same size on the monitored virtual address space. The
frequently accessed for last 300 milliseconds. Finally, the fourth command position of the colun on the row and the number on the column represents the
stops DAMON. relative location and access temperature of the region. ``[...]`` means
unmapped huge regions on the virtual address spaces. The second line shows
additional information for better understanding the heatmap.
Each line of the output from the third line shows which virtual address range
(``addr XX size XX``) of the process is how frequently (``access XX %``)
accessed for how long time (``age XX``). For example, the evelenth region of
~9.5 MiB size is being most frequently accessed for last 3.7 seconds. Finally,
the fourth command stops DAMON.
Note that DAMON can monitor not only virtual address spaces but multiple types Note that DAMON can monitor not only virtual address spaces but multiple types
of address spaces including the physical address space. of address spaces including the physical address space.
@ -95,7 +108,7 @@ Visualizing Recorded Patterns
You can visualize the pattern in a heatmap, showing which memory region You can visualize the pattern in a heatmap, showing which memory region
(x-axis) got accessed when (y-axis) and how frequently (number).:: (x-axis) got accessed when (y-axis) and how frequently (number).::
$ sudo damo report heats --heatmap stdout $ sudo damo report heatmap
22222222222222222222222222222222222222211111111111111111111111111111111111111100 22222222222222222222222222222222222222211111111111111111111111111111111111111100
44444444444444444444444444444444444444434444444444444444444444444444444444443200 44444444444444444444444444444444444444434444444444444444444444444444444444443200
44444444444444444444444444444444444444433444444444444444444444444444444444444200 44444444444444444444444444444444444444433444444444444444444444444444444444444200
@ -160,6 +173,6 @@ Data Access Pattern Aware Memory Management
Below command makes every memory region of size >=4K that has not accessed for Below command makes every memory region of size >=4K that has not accessed for
>=60 seconds in your workload to be swapped out. :: >=60 seconds in your workload to be swapped out. ::
$ sudo damo schemes --damos_access_rate 0 0 --damos_sz_region 4K max \ $ sudo damo start --damos_access_rate 0 0 --damos_sz_region 4K max \
--damos_age 60s max --damos_action pageout \ --damos_age 60s max --damos_action pageout \
<pid of your workload> <pid of your workload>