1f968c6a4SSeongJae Parkwhat: /sys/kernel/mm/damon/ 2f968c6a4SSeongJae ParkDate: Mar 2022 3f968c6a4SSeongJae ParkContact: SeongJae Park <sj@kernel.org> 4f968c6a4SSeongJae ParkDescription: Interface for Data Access MONitoring (DAMON). Contains files 5f968c6a4SSeongJae Park for controlling DAMON. For more details on DAMON itself, 6f968c6a4SSeongJae Park please refer to Documentation/admin-guide/mm/damon/index.rst. 7f968c6a4SSeongJae Park 8f968c6a4SSeongJae ParkWhat: /sys/kernel/mm/damon/admin/ 9f968c6a4SSeongJae ParkDate: Mar 2022 10f968c6a4SSeongJae ParkContact: SeongJae Park <sj@kernel.org> 11f968c6a4SSeongJae ParkDescription: Interface for privileged users of DAMON. Contains files for 12f968c6a4SSeongJae Park controlling DAMON that aimed to be used by privileged users. 13f968c6a4SSeongJae Park 14f968c6a4SSeongJae ParkWhat: /sys/kernel/mm/damon/admin/kdamonds/nr_kdamonds 15f968c6a4SSeongJae ParkDate: Mar 2022 16f968c6a4SSeongJae ParkContact: SeongJae Park <sj@kernel.org> 17f968c6a4SSeongJae ParkDescription: Writing a number 'N' to this file creates the number of 18f968c6a4SSeongJae Park directories for controlling each DAMON worker thread (kdamond) 19f968c6a4SSeongJae Park named '0' to 'N-1' under the kdamonds/ directory. 20f968c6a4SSeongJae Park 21f968c6a4SSeongJae ParkWhat: /sys/kernel/mm/damon/admin/kdamonds/<K>/state 22f968c6a4SSeongJae ParkDate: Mar 2022 23f968c6a4SSeongJae ParkContact: SeongJae Park <sj@kernel.org> 24f968c6a4SSeongJae ParkDescription: Writing 'on' or 'off' to this file makes the kdamond starts or 25f968c6a4SSeongJae Park stops, respectively. Reading the file returns the keywords 26*adc286e6SSeongJae Park based on the current status. Writing 'commit' to this file 27*adc286e6SSeongJae Park makes the kdamond reads the user inputs in the sysfs files 28*adc286e6SSeongJae Park except 'state' again. Writing 'update_schemes_stats' to the 29*adc286e6SSeongJae Park file updates contents of schemes stats files of the kdamond. 30f968c6a4SSeongJae Park 31f968c6a4SSeongJae ParkWhat: /sys/kernel/mm/damon/admin/kdamonds/<K>/pid 32f968c6a4SSeongJae ParkDate: Mar 2022 33f968c6a4SSeongJae ParkContact: SeongJae Park <sj@kernel.org> 34f968c6a4SSeongJae ParkDescription: Reading this file returns the pid of the kdamond if it is 35f968c6a4SSeongJae Park running. 36f968c6a4SSeongJae Park 37f968c6a4SSeongJae ParkWhat: /sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/nr_contexts 38f968c6a4SSeongJae ParkDate: Mar 2022 39f968c6a4SSeongJae ParkContact: SeongJae Park <sj@kernel.org> 40f968c6a4SSeongJae ParkDescription: Writing a number 'N' to this file creates the number of 41f968c6a4SSeongJae Park directories for controlling each DAMON context named '0' to 42f968c6a4SSeongJae Park 'N-1' under the contexts/ directory. 43f968c6a4SSeongJae Park 442fe60ec9SSeongJae ParkWhat: /sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/avail_operations 452fe60ec9SSeongJae ParkDate: Apr 2022 462fe60ec9SSeongJae ParkContact: SeongJae Park <sj@kernel.org> 472fe60ec9SSeongJae ParkDescription: Reading this file returns the available monitoring operations 482fe60ec9SSeongJae Park sets on the currently running kernel. 492fe60ec9SSeongJae Park 50f968c6a4SSeongJae ParkWhat: /sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/operations 51f968c6a4SSeongJae ParkDate: Mar 2022 52f968c6a4SSeongJae ParkContact: SeongJae Park <sj@kernel.org> 53f968c6a4SSeongJae ParkDescription: Writing a keyword for a monitoring operations set ('vaddr' for 5491541808SSeongJae Park virtual address spaces monitoring, 'fvaddr' for fixed virtual 5591541808SSeongJae Park address ranges monitoring, and 'paddr' for the physical address 5691541808SSeongJae Park space monitoring) to this file makes the context to use the 5791541808SSeongJae Park operations set. Reading the file returns the keyword for the 5891541808SSeongJae Park operations set the context is set to use. 5991541808SSeongJae Park 6091541808SSeongJae Park Note that only the operations sets that listed in 6191541808SSeongJae Park 'avail_operations' file are valid inputs. 62f968c6a4SSeongJae Park 63f968c6a4SSeongJae ParkWhat: /sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/monitoring_attrs/intervals/sample_us 64f968c6a4SSeongJae ParkDate: Mar 2022 65f968c6a4SSeongJae ParkContact: SeongJae Park <sj@kernel.org> 66f968c6a4SSeongJae ParkDescription: Writing a value to this file sets the sampling interval of the 67f968c6a4SSeongJae Park DAMON context in microseconds as the value. Reading this file 68f968c6a4SSeongJae Park returns the value. 69f968c6a4SSeongJae Park 70f968c6a4SSeongJae ParkWhat: /sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/monitoring_attrs/intervals/aggr_us 71f968c6a4SSeongJae ParkDate: Mar 2022 72f968c6a4SSeongJae ParkContact: SeongJae Park <sj@kernel.org> 73f968c6a4SSeongJae ParkDescription: Writing a value to this file sets the aggregation interval of 74f968c6a4SSeongJae Park the DAMON context in microseconds as the value. Reading this 75f968c6a4SSeongJae Park file returns the value. 76f968c6a4SSeongJae Park 77f968c6a4SSeongJae ParkWhat: /sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/monitoring_attrs/intervals/update_us 78f968c6a4SSeongJae ParkDate: Mar 2022 79f968c6a4SSeongJae ParkContact: SeongJae Park <sj@kernel.org> 80f968c6a4SSeongJae ParkDescription: Writing a value to this file sets the update interval of the 81f968c6a4SSeongJae Park DAMON context in microseconds as the value. Reading this file 82f968c6a4SSeongJae Park returns the value. 83f968c6a4SSeongJae Park 84f968c6a4SSeongJae ParkWhat: /sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/monitoring_attrs/nr_regions/min 85f968c6a4SSeongJae Park 86f968c6a4SSeongJae ParkWDate: Mar 2022 87f968c6a4SSeongJae ParkContact: SeongJae Park <sj@kernel.org> 88f968c6a4SSeongJae ParkDescription: Writing a value to this file sets the minimum number of 89f968c6a4SSeongJae Park monitoring regions of the DAMON context as the value. Reading 90f968c6a4SSeongJae Park this file returns the value. 91f968c6a4SSeongJae Park 92f968c6a4SSeongJae ParkWhat: /sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/monitoring_attrs/nr_regions/max 93f968c6a4SSeongJae ParkDate: Mar 2022 94f968c6a4SSeongJae ParkContact: SeongJae Park <sj@kernel.org> 95f968c6a4SSeongJae ParkDescription: Writing a value to this file sets the maximum number of 96f968c6a4SSeongJae Park monitoring regions of the DAMON context as the value. Reading 97f968c6a4SSeongJae Park this file returns the value. 98f968c6a4SSeongJae Park 99f968c6a4SSeongJae ParkWhat: /sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/targets/nr_targets 100f968c6a4SSeongJae ParkDate: Mar 2022 101f968c6a4SSeongJae ParkContact: SeongJae Park <sj@kernel.org> 102f968c6a4SSeongJae ParkDescription: Writing a number 'N' to this file creates the number of 103f968c6a4SSeongJae Park directories for controlling each DAMON target of the context 104f968c6a4SSeongJae Park named '0' to 'N-1' under the contexts/ directory. 105f968c6a4SSeongJae Park 106f968c6a4SSeongJae ParkWhat: /sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/targets/<T>/pid_target 107f968c6a4SSeongJae ParkDate: Mar 2022 108f968c6a4SSeongJae ParkContact: SeongJae Park <sj@kernel.org> 109f968c6a4SSeongJae ParkDescription: Writing to and reading from this file sets and gets the pid of 110f968c6a4SSeongJae Park the target process if the context is for virtual address spaces 111f968c6a4SSeongJae Park monitoring, respectively. 112f968c6a4SSeongJae Park 113f968c6a4SSeongJae ParkWhat: /sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/targets/<T>/regions/nr_regions 114f968c6a4SSeongJae ParkDate: Mar 2022 115f968c6a4SSeongJae ParkContact: SeongJae Park <sj@kernel.org> 116f968c6a4SSeongJae ParkDescription: Writing a number 'N' to this file creates the number of 117f968c6a4SSeongJae Park directories for setting each DAMON target memory region of the 118f968c6a4SSeongJae Park context named '0' to 'N-1' under the regions/ directory. In 119f968c6a4SSeongJae Park case of the virtual address space monitoring, DAMON 120f968c6a4SSeongJae Park automatically sets the target memory region based on the target 121f968c6a4SSeongJae Park processes' mappings. 122f968c6a4SSeongJae Park 123f968c6a4SSeongJae ParkWhat: /sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/targets/<T>/regions/<R>/start 124f968c6a4SSeongJae ParkDate: Mar 2022 125f968c6a4SSeongJae ParkContact: SeongJae Park <sj@kernel.org> 126f968c6a4SSeongJae ParkDescription: Writing to and reading from this file sets and gets the start 127f968c6a4SSeongJae Park address of the monitoring region. 128f968c6a4SSeongJae Park 129f968c6a4SSeongJae ParkWhat: /sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/targets/<T>/regions/<R>/end 130f968c6a4SSeongJae ParkDate: Mar 2022 131f968c6a4SSeongJae ParkContact: SeongJae Park <sj@kernel.org> 132f968c6a4SSeongJae ParkDescription: Writing to and reading from this file sets and gets the end 133f968c6a4SSeongJae Park address of the monitoring region. 134f968c6a4SSeongJae Park 135f968c6a4SSeongJae ParkWhat: /sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/nr_schemes 136f968c6a4SSeongJae ParkDate: Mar 2022 137f968c6a4SSeongJae ParkContact: SeongJae Park <sj@kernel.org> 138f968c6a4SSeongJae ParkDescription: Writing a number 'N' to this file creates the number of 139f968c6a4SSeongJae Park directories for controlling each DAMON-based operation scheme 140f968c6a4SSeongJae Park of the context named '0' to 'N-1' under the schemes/ directory. 141f968c6a4SSeongJae Park 142f968c6a4SSeongJae ParkWhat: /sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/action 143f968c6a4SSeongJae ParkDate: Mar 2022 144f968c6a4SSeongJae ParkContact: SeongJae Park <sj@kernel.org> 145f968c6a4SSeongJae ParkDescription: Writing to and reading from this file sets and gets the action 146f968c6a4SSeongJae Park of the scheme. 147f968c6a4SSeongJae Park 148f968c6a4SSeongJae ParkWhat: /sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/access_pattern/sz/min 149f968c6a4SSeongJae ParkDate: Mar 2022 150f968c6a4SSeongJae ParkContact: SeongJae Park <sj@kernel.org> 151f968c6a4SSeongJae ParkDescription: Writing to and reading from this file sets and gets the mimimum 152f968c6a4SSeongJae Park size of the scheme's target regions in bytes. 153f968c6a4SSeongJae Park 154f968c6a4SSeongJae ParkWhat: /sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/access_pattern/sz/max 155f968c6a4SSeongJae ParkDate: Mar 2022 156f968c6a4SSeongJae ParkContact: SeongJae Park <sj@kernel.org> 157f968c6a4SSeongJae ParkDescription: Writing to and reading from this file sets and gets the maximum 158f968c6a4SSeongJae Park size of the scheme's target regions in bytes. 159f968c6a4SSeongJae Park 160f968c6a4SSeongJae ParkWhat: /sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/access_pattern/nr_accesses/min 161f968c6a4SSeongJae ParkDate: Mar 2022 162f968c6a4SSeongJae ParkContact: SeongJae Park <sj@kernel.org> 163f968c6a4SSeongJae ParkDescription: Writing to and reading from this file sets and gets the manimum 164f968c6a4SSeongJae Park 'nr_accesses' of the scheme's target regions. 165f968c6a4SSeongJae Park 166f968c6a4SSeongJae ParkWhat: /sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/access_pattern/nr_accesses/max 167f968c6a4SSeongJae ParkDate: Mar 2022 168f968c6a4SSeongJae ParkContact: SeongJae Park <sj@kernel.org> 169f968c6a4SSeongJae ParkDescription: Writing to and reading from this file sets and gets the maximum 170f968c6a4SSeongJae Park 'nr_accesses' of the scheme's target regions. 171f968c6a4SSeongJae Park 172f968c6a4SSeongJae ParkWhat: /sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/access_pattern/age/min 173f968c6a4SSeongJae ParkDate: Mar 2022 174f968c6a4SSeongJae ParkContact: SeongJae Park <sj@kernel.org> 175f968c6a4SSeongJae ParkDescription: Writing to and reading from this file sets and gets the minimum 176f968c6a4SSeongJae Park 'age' of the scheme's target regions. 177f968c6a4SSeongJae Park 178f968c6a4SSeongJae ParkWhat: /sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/access_pattern/age/max 179f968c6a4SSeongJae ParkDate: Mar 2022 180f968c6a4SSeongJae ParkContact: SeongJae Park <sj@kernel.org> 181f968c6a4SSeongJae ParkDescription: Writing to and reading from this file sets and gets the maximum 182f968c6a4SSeongJae Park 'age' of the scheme's target regions. 183f968c6a4SSeongJae Park 184f968c6a4SSeongJae ParkWhat: /sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/quotas/ms 185f968c6a4SSeongJae ParkDate: Mar 2022 186f968c6a4SSeongJae ParkContact: SeongJae Park <sj@kernel.org> 187f968c6a4SSeongJae ParkDescription: Writing to and reading from this file sets and gets the time 188f968c6a4SSeongJae Park quota of the scheme in milliseconds. 189f968c6a4SSeongJae Park 190f968c6a4SSeongJae ParkWhat: /sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/quotas/bytes 191f968c6a4SSeongJae ParkDate: Mar 2022 192f968c6a4SSeongJae ParkContact: SeongJae Park <sj@kernel.org> 193f968c6a4SSeongJae ParkDescription: Writing to and reading from this file sets and gets the size 194f968c6a4SSeongJae Park quota of the scheme in bytes. 195f968c6a4SSeongJae Park 196f968c6a4SSeongJae ParkWhat: /sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/quotas/reset_interval_ms 197f968c6a4SSeongJae ParkDate: Mar 2022 198f968c6a4SSeongJae ParkContact: SeongJae Park <sj@kernel.org> 199f968c6a4SSeongJae ParkDescription: Writing to and reading from this file sets and gets the quotas 200f968c6a4SSeongJae Park charge reset interval of the scheme in milliseconds. 201f968c6a4SSeongJae Park 202f968c6a4SSeongJae ParkWhat: /sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/quotas/weights/sz_permil 203f968c6a4SSeongJae ParkDate: Mar 2022 204f968c6a4SSeongJae ParkContact: SeongJae Park <sj@kernel.org> 205f968c6a4SSeongJae ParkDescription: Writing to and reading from this file sets and gets the 206f968c6a4SSeongJae Park under-quota limit regions prioritization weight for 'size' in 207f968c6a4SSeongJae Park permil. 208f968c6a4SSeongJae Park 209f968c6a4SSeongJae ParkWhat: /sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/quotas/weights/nr_accesses_permil 210f968c6a4SSeongJae ParkDate: Mar 2022 211f968c6a4SSeongJae ParkContact: SeongJae Park <sj@kernel.org> 212f968c6a4SSeongJae ParkDescription: Writing to and reading from this file sets and gets the 213f968c6a4SSeongJae Park under-quota limit regions prioritization weight for 214f968c6a4SSeongJae Park 'nr_accesses' in permil. 215f968c6a4SSeongJae Park 216f968c6a4SSeongJae ParkWhat: /sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/quotas/weights/age_permil 217f968c6a4SSeongJae ParkDate: Mar 2022 218f968c6a4SSeongJae ParkContact: SeongJae Park <sj@kernel.org> 219f968c6a4SSeongJae ParkDescription: Writing to and reading from this file sets and gets the 220f968c6a4SSeongJae Park under-quota limit regions prioritization weight for 'age' in 221f968c6a4SSeongJae Park permil. 222f968c6a4SSeongJae Park 223f968c6a4SSeongJae ParkWhat: /sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/watermarks/metric 224f968c6a4SSeongJae ParkDate: Mar 2022 225f968c6a4SSeongJae ParkContact: SeongJae Park <sj@kernel.org> 226f968c6a4SSeongJae ParkDescription: Writing to and reading from this file sets and gets the metric 227f968c6a4SSeongJae Park of the watermarks for the scheme. The writable/readable 228f968c6a4SSeongJae Park keywords for this file are 'none' for disabling the watermarks 229f968c6a4SSeongJae Park feature, or 'free_mem_rate' for the system's global free memory 230f968c6a4SSeongJae Park rate in permil. 231f968c6a4SSeongJae Park 232f968c6a4SSeongJae ParkWhat: /sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/watermarks/interval_us 233f968c6a4SSeongJae ParkDate: Mar 2022 234f968c6a4SSeongJae ParkContact: SeongJae Park <sj@kernel.org> 235f968c6a4SSeongJae ParkDescription: Writing to and reading from this file sets and gets the metric 236f968c6a4SSeongJae Park check interval of the watermarks for the scheme in 237f968c6a4SSeongJae Park microseconds. 238f968c6a4SSeongJae Park 239f968c6a4SSeongJae ParkWhat: /sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/watermarks/high 240f968c6a4SSeongJae ParkDate: Mar 2022 241f968c6a4SSeongJae ParkContact: SeongJae Park <sj@kernel.org> 242f968c6a4SSeongJae ParkDescription: Writing to and reading from this file sets and gets the high 243f968c6a4SSeongJae Park watermark of the scheme in permil. 244f968c6a4SSeongJae Park 245f968c6a4SSeongJae ParkWhat: /sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/watermarks/mid 246f968c6a4SSeongJae ParkDate: Mar 2022 247f968c6a4SSeongJae ParkContact: SeongJae Park <sj@kernel.org> 248f968c6a4SSeongJae ParkDescription: Writing to and reading from this file sets and gets the mid 249f968c6a4SSeongJae Park watermark of the scheme in permil. 250f968c6a4SSeongJae Park 251f968c6a4SSeongJae ParkWhat: /sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/watermarks/low 252f968c6a4SSeongJae ParkDate: Mar 2022 253f968c6a4SSeongJae ParkContact: SeongJae Park <sj@kernel.org> 254f968c6a4SSeongJae ParkDescription: Writing to and reading from this file sets and gets the low 255f968c6a4SSeongJae Park watermark of the scheme in permil. 256f968c6a4SSeongJae Park 257f968c6a4SSeongJae ParkWhat: /sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/stats/nr_tried 258f968c6a4SSeongJae ParkDate: Mar 2022 259f968c6a4SSeongJae ParkContact: SeongJae Park <sj@kernel.org> 260f968c6a4SSeongJae ParkDescription: Reading this file returns the number of regions that the action 261f968c6a4SSeongJae Park of the scheme has tried to be applied. 262f968c6a4SSeongJae Park 263f968c6a4SSeongJae ParkWhat: /sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/stats/sz_tried 264f968c6a4SSeongJae ParkDate: Mar 2022 265f968c6a4SSeongJae ParkContact: SeongJae Park <sj@kernel.org> 266f968c6a4SSeongJae ParkDescription: Reading this file returns the total size of regions that the 267f968c6a4SSeongJae Park action of the scheme has tried to be applied in bytes. 268f968c6a4SSeongJae Park 269f968c6a4SSeongJae ParkWhat: /sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/stats/nr_applied 270f968c6a4SSeongJae ParkDate: Mar 2022 271f968c6a4SSeongJae ParkContact: SeongJae Park <sj@kernel.org> 272f968c6a4SSeongJae ParkDescription: Reading this file returns the number of regions that the action 273f968c6a4SSeongJae Park of the scheme has successfully applied. 274f968c6a4SSeongJae Park 275f968c6a4SSeongJae ParkWhat: /sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/stats/sz_applied 276f968c6a4SSeongJae ParkDate: Mar 2022 277f968c6a4SSeongJae ParkContact: SeongJae Park <sj@kernel.org> 278f968c6a4SSeongJae ParkDescription: Reading this file returns the total size of regions that the 279f968c6a4SSeongJae Park action of the scheme has successfully applied in bytes. 280f968c6a4SSeongJae Park 281f968c6a4SSeongJae ParkWhat: /sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/stats/qt_exceeds 282f968c6a4SSeongJae ParkDate: Mar 2022 283f968c6a4SSeongJae ParkContact: SeongJae Park <sj@kernel.org> 284f968c6a4SSeongJae ParkDescription: Reading this file returns the number of the exceed events of 285f968c6a4SSeongJae Park the scheme's quotas. 286