@@ -257,12 +257,9 @@ be equal or smaller than ``start`` of directory ``N+1``.
257
257
contexts/<N>/schemes/
258
258
---------------------
259
259
260
- For usual DAMON-based data access aware memory management optimizations, users
261
- would normally want the system to apply a memory management action to a memory
262
- region of a specific access pattern. DAMON receives such formalized operation
263
- schemes from the user and applies those to the target memory regions. Users
264
- can get and set the schemes by reading from and writing to files under this
265
- directory.
260
+ The directory for DAMON-based Operation Schemes (:ref: `DAMOS
261
+ <damon_design_damos>`). Users can get and set the schemes by reading from and
262
+ writing to files under this directory.
266
263
267
264
In the beginning, this directory has only one file, ``nr_schemes ``. Writing a
268
265
number (``N ``) to the file creates the number of child directories named ``0 ``
@@ -275,9 +272,9 @@ In each scheme directory, five directories (``access_pattern``, ``quotas``,
275
272
``watermarks ``, ``filters ``, ``stats ``, and ``tried_regions ``) and one file
276
273
(``action ``) exist.
277
274
278
- The ``action `` file is for setting and getting what action you want to apply to
279
- memory regions having specific access pattern of the interest. The keywords
280
- that can be written to and read from the file and their meaning are as below.
275
+ The ``action `` file is for setting and getting the scheme's :ref: ` action
276
+ <damon_design_damos_action>`. The keywords that can be written to and read
277
+ from the file and their meaning are as below.
281
278
282
279
Note that support of each action depends on the running DAMON operations set
283
280
:ref: `implementation <sysfs_contexts >`.
@@ -302,10 +299,8 @@ Note that support of each action depends on the running DAMON operations set
302
299
schemes/<N>/access_pattern/
303
300
---------------------------
304
301
305
- The target access pattern of each DAMON-based operation scheme is constructed
306
- with three ranges including the size of the region in bytes, number of
307
- monitored accesses per aggregate interval, and number of aggregated intervals
308
- for the age of the region.
302
+ The directory for the target access :ref: `pattern
303
+ <damon_design_damos_access_pattern>` of the given DAMON-based operation scheme.
309
304
310
305
Under the ``access_pattern `` directory, three directories (``sz ``,
311
306
``nr_accesses ``, and ``age ``) each having two files (``min `` and ``max ``)
@@ -316,42 +311,29 @@ to and reading from the ``min`` and ``max`` files under ``sz``,
316
311
schemes/<N>/quotas/
317
312
-------------------
318
313
319
- Optimal ``target access pattern `` for each ``action `` is workload dependent, so
320
- not easy to find. Worse yet, setting a scheme of some action too aggressive
321
- can cause severe overhead. To avoid such overhead, users can limit time and
322
- size quota for each scheme. In detail, users can ask DAMON to try to use only
323
- up to specific time (``time quota ``) for applying the action, and to apply the
324
- action to only up to specific amount (``size quota ``) of memory regions having
325
- the target access pattern within a given time interval (``reset interval ``).
326
-
327
- When the quota limit is expected to be exceeded, DAMON prioritizes found memory
328
- regions of the ``target access pattern `` based on their size, access frequency,
329
- and age. For personalized prioritization, users can set the weights for the
330
- three properties.
314
+ The directory for the :ref: `quotas <damon_design_damos_quotas >` of the given
315
+ DAMON-based operation scheme.
331
316
332
317
Under ``quotas `` directory, three files (``ms ``, ``bytes ``,
333
318
``reset_interval_ms ``) and one directory (``weights ``) having three files
334
319
(``sz_permil ``, ``nr_accesses_permil ``, and ``age_permil ``) in it exist.
335
320
336
321
You can set the ``time quota `` in milliseconds, ``size quota `` in bytes, and
337
322
``reset interval `` in milliseconds by writing the values to the three files,
338
- respectively. You can also set the prioritization weights for size, access
339
- frequency, and age in per-thousand unit by writing the values to the three
340
- files under the ``weights `` directory.
323
+ respectively. You can also set the :ref: `prioritization weights
324
+ <damon_design_damos_quotas_prioritization>` for size, access frequency, and age
325
+ in per-thousand unit by writing the values to the three files under the
326
+ ``weights `` directory.
341
327
342
328
schemes/<N>/watermarks/
343
329
-----------------------
344
330
345
- To allow easy activation and deactivation of each scheme based on system
346
- status, DAMON provides a feature called watermarks. The feature receives five
347
- values called ``metric ``, ``interval ``, ``high ``, ``mid ``, and ``low ``. The
348
- ``metric `` is the system metric such as free memory ratio that can be measured.
349
- If the metric value of the system is higher than the value in ``high `` or lower
350
- than ``low `` at the memoent, the scheme is deactivated. If the value is lower
351
- than ``mid ``, the scheme is activated.
331
+ The directory for the :ref: `watermarks <damon_design_damos_watermarks >` of the
332
+ given DAMON-based operation scheme.
352
333
353
334
Under the watermarks directory, five files (``metric ``, ``interval_us ``,
354
- ``high ``, ``mid ``, and ``low ``) for setting each value exist. You can set and
335
+ ``high ``, ``mid ``, and ``low ``) for setting the metric, the time interval
336
+ between check of the metric, and the three watermarks exist. You can set and
355
337
get the five values by writing to the files, respectively.
356
338
357
339
Keywords and meanings of those that can be written to the ``metric `` file are
@@ -365,12 +347,8 @@ The ``interval`` should written in microseconds unit.
365
347
schemes/<N>/filters/
366
348
--------------------
367
349
368
- Users could know something more than the kernel for specific types of memory.
369
- In the case, users could do their own management for the memory and hence
370
- doesn't want DAMOS bothers that. Users could limit DAMOS by setting the access
371
- pattern of the scheme and/or the monitoring regions for the purpose, but that
372
- can be inefficient in some cases. In such cases, users could set non-access
373
- pattern driven filters using files in this directory.
350
+ The directory for the :ref: `filters <damon_design_damos_filters >` of the given
351
+ DAMON-based operation scheme.
374
352
375
353
In the beginning, this directory has only one file, ``nr_filters ``. Writing a
376
354
number (``N ``) to the file creates the number of child directories named ``0 ``
@@ -597,15 +575,10 @@ update.
597
575
Schemes
598
576
-------
599
577
600
- For usual DAMON-based data access aware memory management optimizations, users
601
- would simply want the system to apply a memory management action to a memory
602
- region of a specific access pattern. DAMON receives such formalized operation
603
- schemes from the user and applies those to the target processes.
604
-
605
- Users can get and set the schemes by reading from and writing to ``schemes ``
606
- debugfs file. Reading the file also shows the statistics of each scheme. To
607
- the file, each of the schemes should be represented in each line in below
608
- form::
578
+ Users can get and set the DAMON-based operation :ref: `schemes
579
+ <damon_design_damos>` by reading from and writing to ``schemes `` debugfs file.
580
+ Reading the file also shows the statistics of each scheme. To the file, each
581
+ of the schemes should be represented in each line in below form::
609
582
610
583
<target access pattern> <action> <quota> <watermarks>
611
584
@@ -614,8 +587,9 @@ You can disable schemes by simply writing an empty string to the file.
614
587
Target Access Pattern
615
588
~~~~~~~~~~~~~~~~~~~~~
616
589
617
- The ``<target access pattern> `` is constructed with three ranges in below
618
- form::
590
+ The target access :ref: `pattern <damon_design_damos_access_pattern >` of the
591
+ scheme. The ``<target access pattern> `` is constructed with three ranges in
592
+ below form::
619
593
620
594
min-size max-size min-acc max-acc min-age max-age
621
595
@@ -628,9 +602,9 @@ closed interval.
628
602
Action
629
603
~~~~~~
630
604
631
- The ``<action> `` is a predefined integer for memory management actions, which
632
- DAMON will apply to the regions having the target access pattern. The
633
- supported numbers and their meanings are as below.
605
+ The ``<action> `` is a predefined integer for memory management :ref: ` actions
606
+ <damon_design_damos_action>`. The supported numbers and their meanings are as
607
+ below.
634
608
635
609
- 0: Call ``madvise() `` for the region with ``MADV_WILLNEED ``. Ignored if
636
610
``target `` is ``paddr ``.
@@ -646,10 +620,8 @@ supported numbers and their meanings are as below.
646
620
Quota
647
621
~~~~~
648
622
649
- Optimal ``target access pattern `` for each ``action `` is workload dependent, so
650
- not easy to find. Worse yet, setting a scheme of some action too aggressive
651
- can cause severe overhead. To avoid such overhead, users can limit time and
652
- size quota for the scheme via the ``<quota> `` in below form::
623
+ Users can set the :ref: `quotas <damon_design_damos_quotas >` of the given scheme
624
+ via the ``<quota> `` in below form::
653
625
654
626
<ms> <sz> <reset interval> <priority weights>
655
627
@@ -659,19 +631,17 @@ the action to memory regions of the ``target access pattern`` within the
659
631
``<sz> `` bytes of memory regions within the ``<reset interval> ``. Setting both
660
632
``<ms> `` and ``<sz> `` zero disables the quota limits.
661
633
662
- When the quota limit is expected to be exceeded, DAMON prioritizes found memory
663
- regions of the ``target access pattern `` based on their size, access frequency,
664
- and age. For personalized prioritization, users can set the weights for the
665
- three properties in ``<priority weights> `` in below form::
634
+ For the :ref: `prioritization <damon_design_damos_quotas_prioritization >`, users
635
+ can set the weights for the three properties in ``<priority weights> `` in below
636
+ form::
666
637
667
638
<size weight> <access frequency weight> <age weight>
668
639
669
640
Watermarks
670
641
~~~~~~~~~~
671
642
672
- Some schemes would need to run based on current value of the system's specific
673
- metrics like free memory ratio. For such cases, users can specify watermarks
674
- for the condition.::
643
+ Users can specify :ref: `watermarks <damon_design_damos_watermarks >` of the
644
+ given scheme via ``<watermarks> `` in below form::
675
645
676
646
<metric> <check interval> <high mark> <middle mark> <low mark>
677
647
0 commit comments