stat.rst 3.6 KB

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