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