xref: /linux/Documentation/admin-guide/mm/damon/stat.rst (revision 8d2b0853add1d7534dc0794e3c8e0b9e8c4ec640)
1.. SPDX-License-Identifier: GPL-2.0
2
3===================================
4Data Access Monitoring Results Stat
5===================================
6
7Data Access Monitoring Results Stat (DAMON_STAT) is a static kernel module that
8is aimed to be used for simple access pattern monitoring.  It monitors accesses
9on the system's entire physical memory using DAMON, and provides simplified
10access monitoring results statistics, namely idle time percentiles and
11estimated memory bandwidth.
12
13Monitoring Accuracy and Overhead
14================================
15
16DAMON_STAT uses monitoring intervals :ref:`auto-tuning
17<damon_design_monitoring_intervals_autotuning>` to make its accuracy high and
18overhead minimum.  It auto-tunes the intervals aiming 4 % of observable access
19events to be captured in each snapshot, while limiting the resulting sampling
20events to be 5 milliseconds in minimum and 10 seconds in maximum.  On a few
21production server systems, it resulted in consuming only 0.x % single CPU time,
22while capturing reasonable quality of access patterns.
23
24Interface: Module Parameters
25============================
26
27To use this feature, you should first ensure your system is running on a kernel
28that is built with ``CONFIG_DAMON_STAT=y``.  The feature can be enabled by
29default at build time, by setting ``CONFIG_DAMON_STAT_ENABLED_DEFAULT`` true.
30
31To let sysadmins enable or disable it at boot and/or runtime, and read the
32monitoring results, DAMON_STAT provides module parameters.  Following
33sections are descriptions of the parameters.
34
35enabled
36-------
37
38Enable or disable DAMON_STAT.
39
40You can enable DAMON_STAT by setting the value of this parameter as ``Y``.
41Setting it as ``N`` disables DAMON_STAT.  The default value is set by
42``CONFIG_DAMON_STAT_ENABLED_DEFAULT`` build config option.
43
44estimated_memory_bandwidth
45--------------------------
46
47Estimated memory bandwidth consumption (bytes per second) of the system.
48
49DAMON_STAT reads observed access events on the current DAMON results snapshot
50and converts it to memory bandwidth consumption estimation in bytes per second.
51The resulting metric is exposed to user via this read-only parameter.  Because
52DAMON uses sampling, this is only an estimation of the access intensity rather
53than accurate memory bandwidth.
54
55memory_idle_ms_percentiles
56--------------------------
57
58Per-byte idle time (milliseconds) percentiles of the system.
59
60DAMON_STAT calculates how long each byte of the memory was not accessed until
61now (idle time), based on the current DAMON results snapshot.  If DAMON found a
62region of access frequency (nr_accesses) larger than zero, every byte of the
63region gets zero idle time.  If a region has zero access frequency
64(nr_accesses), how long the region was keeping the zero access frequency (age)
65becomes the idle time of every byte of the region.  Then, DAMON_STAT exposes
66the percentiles of the idle time values via this read-only parameter.  Reading
67the parameter returns 101 idle time values in milliseconds, separated by comma.
68Each value represents 0-th, 1st, 2nd, 3rd, ..., 99th and 100th percentile idle
69times.
70