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