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 'update_schemes_tried_bytes' to the
33		file updates only '.../tried_regions/total_bytes' files of this
34		kdamond.  Writing 'clear_schemes_tried_regions' to the file
35		removes contents of the 'tried_regions' directory.
36
37What:		/sys/kernel/mm/damon/admin/kdamonds/<K>/pid
38Date:		Mar 2022
39Contact:	SeongJae Park <sj@kernel.org>
40Description:	Reading this file returns the pid of the kdamond if it is
41		running.
42
43What:		/sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/nr_contexts
44Date:		Mar 2022
45Contact:	SeongJae Park <sj@kernel.org>
46Description:	Writing a number 'N' to this file creates the number of
47		directories for controlling each DAMON context named '0' to
48		'N-1' under the contexts/ directory.
49
50What:		/sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/avail_operations
51Date:		Apr 2022
52Contact:	SeongJae Park <sj@kernel.org>
53Description:	Reading this file returns the available monitoring operations
54		sets on the currently running kernel.
55
56What:		/sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/operations
57Date:		Mar 2022
58Contact:	SeongJae Park <sj@kernel.org>
59Description:	Writing a keyword for a monitoring operations set ('vaddr' for
60		virtual address spaces monitoring, 'fvaddr' for fixed virtual
61		address ranges monitoring, and 'paddr' for the physical address
62		space monitoring) to this file makes the context to use the
63		operations set.  Reading the file returns the keyword for the
64		operations set the context is set to use.
65
66		Note that only the operations sets that listed in
67		'avail_operations' file are valid inputs.
68
69What:		/sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/monitoring_attrs/intervals/sample_us
70Date:		Mar 2022
71Contact:	SeongJae Park <sj@kernel.org>
72Description:	Writing a value to this file sets the sampling interval of the
73		DAMON context in microseconds as the value.  Reading this file
74		returns the value.
75
76What:		/sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/monitoring_attrs/intervals/aggr_us
77Date:		Mar 2022
78Contact:	SeongJae Park <sj@kernel.org>
79Description:	Writing a value to this file sets the aggregation interval of
80		the DAMON context in microseconds as the value.  Reading this
81		file returns the value.
82
83What:		/sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/monitoring_attrs/intervals/update_us
84Date:		Mar 2022
85Contact:	SeongJae Park <sj@kernel.org>
86Description:	Writing a value to this file sets the update interval of the
87		DAMON context in microseconds as the value.  Reading this file
88		returns the value.
89
90What:		/sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/monitoring_attrs/nr_regions/min
91
92WDate:		Mar 2022
93Contact:	SeongJae Park <sj@kernel.org>
94Description:	Writing a value to this file sets the minimum number of
95		monitoring regions of the DAMON context as the value.  Reading
96		this file returns the value.
97
98What:		/sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/monitoring_attrs/nr_regions/max
99Date:		Mar 2022
100Contact:	SeongJae Park <sj@kernel.org>
101Description:	Writing a value to this file sets the maximum number of
102		monitoring regions of the DAMON context as the value.  Reading
103		this file returns the value.
104
105What:		/sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/targets/nr_targets
106Date:		Mar 2022
107Contact:	SeongJae Park <sj@kernel.org>
108Description:	Writing a number 'N' to this file creates the number of
109		directories for controlling each DAMON target of the context
110		named '0' to 'N-1' under the contexts/ directory.
111
112What:		/sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/targets/<T>/pid_target
113Date:		Mar 2022
114Contact:	SeongJae Park <sj@kernel.org>
115Description:	Writing to and reading from this file sets and gets the pid of
116		the target process if the context is for virtual address spaces
117		monitoring, respectively.
118
119What:		/sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/targets/<T>/regions/nr_regions
120Date:		Mar 2022
121Contact:	SeongJae Park <sj@kernel.org>
122Description:	Writing a number 'N' to this file creates the number of
123		directories for setting each DAMON target memory region of the
124		context named '0' to 'N-1' under the regions/ directory.  In
125		case of the virtual address space monitoring, DAMON
126		automatically sets the target memory region based on the target
127		processes' mappings.
128
129What:		/sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/targets/<T>/regions/<R>/start
130Date:		Mar 2022
131Contact:	SeongJae Park <sj@kernel.org>
132Description:	Writing to and reading from this file sets and gets the start
133		address of the monitoring region.
134
135What:		/sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/targets/<T>/regions/<R>/end
136Date:		Mar 2022
137Contact:	SeongJae Park <sj@kernel.org>
138Description:	Writing to and reading from this file sets and gets the end
139		address of the monitoring region.
140
141What:		/sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/nr_schemes
142Date:		Mar 2022
143Contact:	SeongJae Park <sj@kernel.org>
144Description:	Writing a number 'N' to this file creates the number of
145		directories for controlling each DAMON-based operation scheme
146		of the context named '0' to 'N-1' under the schemes/ directory.
147
148What:		/sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/action
149Date:		Mar 2022
150Contact:	SeongJae Park <sj@kernel.org>
151Description:	Writing to and reading from this file sets and gets the action
152		of the scheme.
153
154What:		/sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/access_pattern/sz/min
155Date:		Mar 2022
156Contact:	SeongJae Park <sj@kernel.org>
157Description:	Writing to and reading from this file sets and gets the mimimum
158		size of the scheme's target regions in bytes.
159
160What:		/sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/access_pattern/sz/max
161Date:		Mar 2022
162Contact:	SeongJae Park <sj@kernel.org>
163Description:	Writing to and reading from this file sets and gets the maximum
164		size of the scheme's target regions in bytes.
165
166What:		/sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/access_pattern/nr_accesses/min
167Date:		Mar 2022
168Contact:	SeongJae Park <sj@kernel.org>
169Description:	Writing to and reading from this file sets and gets the manimum
170		'nr_accesses' of the scheme's target regions.
171
172What:		/sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/access_pattern/nr_accesses/max
173Date:		Mar 2022
174Contact:	SeongJae Park <sj@kernel.org>
175Description:	Writing to and reading from this file sets and gets the maximum
176		'nr_accesses' of the scheme's target regions.
177
178What:		/sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/access_pattern/age/min
179Date:		Mar 2022
180Contact:	SeongJae Park <sj@kernel.org>
181Description:	Writing to and reading from this file sets and gets the minimum
182		'age' of the scheme's target regions.
183
184What:		/sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/access_pattern/age/max
185Date:		Mar 2022
186Contact:	SeongJae Park <sj@kernel.org>
187Description:	Writing to and reading from this file sets and gets the maximum
188		'age' of the scheme's target regions.
189
190What:		/sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/quotas/ms
191Date:		Mar 2022
192Contact:	SeongJae Park <sj@kernel.org>
193Description:	Writing to and reading from this file sets and gets the time
194		quota of the scheme in milliseconds.
195
196What:		/sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/quotas/bytes
197Date:		Mar 2022
198Contact:	SeongJae Park <sj@kernel.org>
199Description:	Writing to and reading from this file sets and gets the size
200		quota of the scheme in bytes.
201
202What:		/sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/quotas/reset_interval_ms
203Date:		Mar 2022
204Contact:	SeongJae Park <sj@kernel.org>
205Description:	Writing to and reading from this file sets and gets the quotas
206		charge reset interval of the scheme in milliseconds.
207
208What:		/sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/quotas/weights/sz_permil
209Date:		Mar 2022
210Contact:	SeongJae Park <sj@kernel.org>
211Description:	Writing to and reading from this file sets and gets the
212		under-quota limit regions prioritization weight for 'size' in
213		permil.
214
215What:		/sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/quotas/weights/nr_accesses_permil
216Date:		Mar 2022
217Contact:	SeongJae Park <sj@kernel.org>
218Description:	Writing to and reading from this file sets and gets the
219		under-quota limit regions prioritization weight for
220		'nr_accesses' in permil.
221
222What:		/sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/quotas/weights/age_permil
223Date:		Mar 2022
224Contact:	SeongJae Park <sj@kernel.org>
225Description:	Writing to and reading from this file sets and gets the
226		under-quota limit regions prioritization weight for 'age' in
227		permil.
228
229What:		/sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/watermarks/metric
230Date:		Mar 2022
231Contact:	SeongJae Park <sj@kernel.org>
232Description:	Writing to and reading from this file sets and gets the metric
233		of the watermarks for the scheme.  The writable/readable
234		keywords for this file are 'none' for disabling the watermarks
235		feature, or 'free_mem_rate' for the system's global free memory
236		rate in permil.
237
238What:		/sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/watermarks/interval_us
239Date:		Mar 2022
240Contact:	SeongJae Park <sj@kernel.org>
241Description:	Writing to and reading from this file sets and gets the metric
242		check interval of the watermarks for the scheme in
243		microseconds.
244
245What:		/sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/watermarks/high
246Date:		Mar 2022
247Contact:	SeongJae Park <sj@kernel.org>
248Description:	Writing to and reading from this file sets and gets the high
249		watermark of the scheme in permil.
250
251What:		/sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/watermarks/mid
252Date:		Mar 2022
253Contact:	SeongJae Park <sj@kernel.org>
254Description:	Writing to and reading from this file sets and gets the mid
255		watermark of the scheme in permil.
256
257What:		/sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/watermarks/low
258Date:		Mar 2022
259Contact:	SeongJae Park <sj@kernel.org>
260Description:	Writing to and reading from this file sets and gets the low
261		watermark of the scheme in permil.
262
263What:		/sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/filters/nr_filters
264Date:		Dec 2022
265Contact:	SeongJae Park <sj@kernel.org>
266Description:	Writing a number 'N' to this file creates the number of
267		directories for setting filters of the scheme named '0' to
268		'N-1' under the filters/ directory.
269
270What:		/sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/filters/<F>/type
271Date:		Dec 2022
272Contact:	SeongJae Park <sj@kernel.org>
273Description:	Writing to and reading from this file sets and gets the type of
274		the memory of the interest.  'anon' for anonymous pages, or
275		'memcg' for specific memory cgroup can be written and read.
276
277What:		/sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/filters/<F>/memcg_path
278Date:		Dec 2022
279Contact:	SeongJae Park <sj@kernel.org>
280Description:	If 'memcg' is written to the 'type' file, writing to and
281		reading from this file sets and gets the path to the memory
282		cgroup of the interest.
283
284What:		/sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/filters/<F>/matching
285Date:		Dec 2022
286Contact:	SeongJae Park <sj@kernel.org>
287Description:	Writing 'Y' or 'N' to this file sets whether to filter out
288		pages that do or do not match to the 'type' and 'memcg_path',
289		respectively.  Filter out means the action of the scheme will
290		not be applied to.
291
292What:		/sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/stats/nr_tried
293Date:		Mar 2022
294Contact:	SeongJae Park <sj@kernel.org>
295Description:	Reading this file returns the number of regions that the action
296		of the scheme has tried to be applied.
297
298What:		/sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/stats/sz_tried
299Date:		Mar 2022
300Contact:	SeongJae Park <sj@kernel.org>
301Description:	Reading this file returns the total size of regions that the
302		action of the scheme has tried to be applied in bytes.
303
304What:		/sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/stats/nr_applied
305Date:		Mar 2022
306Contact:	SeongJae Park <sj@kernel.org>
307Description:	Reading this file returns the number of regions that the action
308		of the scheme has successfully applied.
309
310What:		/sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/stats/sz_applied
311Date:		Mar 2022
312Contact:	SeongJae Park <sj@kernel.org>
313Description:	Reading this file returns the total size of regions that the
314		action of the scheme has successfully applied in bytes.
315
316What:		/sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/stats/qt_exceeds
317Date:		Mar 2022
318Contact:	SeongJae Park <sj@kernel.org>
319Description:	Reading this file returns the number of the exceed events of
320		the scheme's quotas.
321
322What:		/sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/tried_regions/total_bytes
323Date:		Jul 2023
324Contact:	SeongJae Park <sj@kernel.org>
325Description:	Reading this file returns the total amount of memory that
326		corresponding DAMON-based Operation Scheme's action has tried
327		to be applied.
328
329What:		/sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/tried_regions/<R>/start
330Date:		Oct 2022
331Contact:	SeongJae Park <sj@kernel.org>
332Description:	Reading this file returns the start address of a memory region
333		that corresponding DAMON-based Operation Scheme's action has
334		tried to be applied.
335
336What:		/sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/tried_regions/<R>/end
337Date:		Oct 2022
338Contact:	SeongJae Park <sj@kernel.org>
339Description:	Reading this file returns the end address of a memory region
340		that corresponding DAMON-based Operation Scheme's action has
341		tried to be applied.
342
343What:		/sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/tried_regions/<R>/nr_accesses
344Date:		Oct 2022
345Contact:	SeongJae Park <sj@kernel.org>
346Description:	Reading this file returns the 'nr_accesses' of a memory region
347		that corresponding DAMON-based Operation Scheme's action has
348		tried to be applied.
349
350What:		/sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/tried_regions/<R>/age
351Date:		Oct 2022
352Contact:	SeongJae Park <sj@kernel.org>
353Description:	Reading this file returns the 'age' of a memory region that
354		corresponding DAMON-based Operation Scheme's action has tried
355		to be applied.
356