| @@ -66,11 +66,17 @@ comma (","). · 65 unmodified lines |
| 66 | │ :ref:`kdamonds <sysfs_kdamonds>`/nr_kdamonds | 66 | │ :ref:`kdamonds <sysfs_kdamonds>`/nr_kdamonds |
| 67 | │ │ :ref:`0 <sysfs_kdamond>`/state,pid,refresh_ms | 67 | │ │ :ref:`0 <sysfs_kdamond>`/state,pid,refresh_ms |
| 68 | │ │ │ :ref:`contexts <sysfs_contexts>`/nr_contexts | 68 | │ │ │ :ref:`contexts <sysfs_contexts>`/nr_contexts |
| 69 | │ │ │ │ :ref:`0 <sysfs_context>`/avail_operations,operations,addr_unit | 69 | │ │ │ │ :ref:`0 <sysfs_context>`/avail_operations,operations,addr_unit, |
| | 70 | │ │ │ │ pause |
| 70 | │ │ │ │ │ :ref:`monitoring_attrs <sysfs_monitoring_attrs>`/ | 71 | │ │ │ │ │ :ref:`monitoring_attrs <sysfs_monitoring_attrs>`/ |
| 71 | │ │ │ │ │ │ intervals/sample_us,aggr_us,update_us | 72 | │ │ │ │ │ │ intervals/sample_us,aggr_us,update_us |
| 72 | │ │ │ │ │ │ │ intervals_goal/access_bp,aggrs,min_sample_us,max_sample_us | 73 | │ │ │ │ │ │ │ intervals_goal/access_bp,aggrs,min_sample_us,max_sample_us |
| 73 | │ │ │ │ │ │ nr_regions/min,max | 74 | │ │ │ │ │ │ nr_regions/min,max |
| | 75 | │ │ │ │ │ │ :ref:`probes <damon_usage_sysfs_probes>`/nr_probes |
| | 76 | │ │ │ │ │ │ │ 0/filters/nr_filters |
| | 77 | │ │ │ │ │ │ │ │ 0/type,matching,allow,path |
| | 78 | │ │ │ │ │ │ │ │ ... |
| | 79 | │ │ │ │ │ │ │ ... |
| 74 | │ │ │ │ │ :ref:`targets <sysfs_targets>`/nr_targets | 80 | │ │ │ │ │ :ref:`targets <sysfs_targets>`/nr_targets |
| 75 | │ │ │ │ │ │ :ref:`0 <sysfs_target>`/pid_target,obsolete_target | 81 | │ │ │ │ │ │ :ref:`0 <sysfs_target>`/pid_target,obsolete_target |
| 76 | │ │ │ │ │ │ │ :ref:`regions <sysfs_regions>`/nr_regions | 82 | │ │ │ │ │ │ │ :ref:`regions <sysfs_regions>`/nr_regions |
| @@ -83,18 +89,23 @@ comma (","). · 6 unmodified lines |
| 83 | │ │ │ │ │ │ │ │ sz/min,max | 89 | │ │ │ │ │ │ │ │ sz/min,max |
| 84 | │ │ │ │ │ │ │ │ nr_accesses/min,max | 90 | │ │ │ │ │ │ │ │ nr_accesses/min,max |
| 85 | │ │ │ │ │ │ │ │ age/min,max | 91 | │ │ │ │ │ │ │ │ age/min,max |
| 86 | │ │ │ │ │ │ │ :ref:`quotas <sysfs_quotas>`/ms,bytes,reset_interval_ms,effective_bytes,goal_tuner | 92 | │ │ │ │ │ │ │ :ref:`quotas <sysfs_quotas>`/ms,bytes,reset_interval_ms, |
| | 93 | │ │ │ │ │ │ │ effective_bytes,goal_tuner, |
| | 94 | │ │ │ │ │ │ │ fail_charge_num,fail_charge_denom |
| 87 | │ │ │ │ │ │ │ │ weights/sz_permil,nr_accesses_permil,age_permil | 95 | │ │ │ │ │ │ │ │ weights/sz_permil,nr_accesses_permil,age_permil |
| 88 | │ │ │ │ │ │ │ │ :ref:`goals <sysfs_schemes_quota_goals>`/nr_goals | 96 | │ │ │ │ │ │ │ │ :ref:`goals <sysfs_schemes_quota_goals>`/nr_goals |
| 89 | │ │ │ │ │ │ │ │ │ 0/target_metric,target_value,current_value,nid,path | 97 | │ │ │ │ │ │ │ │ │ 0/target_metric,target_value,current_value,nid,path |
| 90 | │ │ │ │ │ │ │ :ref:`watermarks <sysfs_watermarks>`/metric,interval_us,high,mid,low | 98 | │ │ │ │ │ │ │ :ref:`watermarks <sysfs_watermarks>`/metric,interval_us,high,mid,low |
| 91 | │ │ │ │ │ │ │ :ref:`{core_,ops_,}filters <sysfs_filters>`/nr_filters | 99 | │ │ │ │ │ │ │ :ref:`{core_,ops_,}filters <sysfs_filters>`/nr_filters |
| 92 | │ │ │ │ │ │ │ │ 0/type,matching,allow,memcg_path,addr_start,addr_end,target_idx,min,max | 100 | │ │ │ │ │ │ │ │ 0/type,matching,allow,memcg_path,addr_start,addr_end,damon_target_idx,min,max |
| 93 | │ │ │ │ │ │ │ :ref:`dests <damon_sysfs_dests>`/nr_dests | 101 | │ │ │ │ │ │ │ :ref:`dests <damon_sysfs_dests>`/nr_dests |
| 94 | │ │ │ │ │ │ │ │ 0/id,weight | 102 | │ │ │ │ │ │ │ │ 0/id,weight |
| 95 | │ │ │ │ │ │ │ :ref:`stats <sysfs_schemes_stats>`/nr_tried,sz_tried,nr_applied,sz_applied,sz_ops_filter_passed,qt_exceeds,nr_snapshots,max_nr_snapshots | 103 | │ │ │ │ │ │ │ :ref:`stats <sysfs_schemes_stats>`/nr_tried,sz_tried,nr_applied,sz_applied,sz_ops_filter_passed,qt_exceeds,nr_snapshots,max_nr_snapshots |
| 96 | │ │ │ │ │ │ │ :ref:`tried_regions <sysfs_schemes_tried_regions>`/total_bytes | 104 | │ │ │ │ │ │ │ :ref:`tried_regions <sysfs_schemes_tried_regions>`/total_bytes |
| 97 | │ │ │ │ │ │ │ │ 0/start,end,nr_accesses,age,sz_filter_passed | 105 | │ │ │ │ │ │ │ │ 0/start,end,nr_accesses,age,sz_filter_passed |
| | 106 | │ │ │ │ │ │ │ │ │ probes |
| | 107 | │ │ │ │ │ │ │ │ │ │ 0/hits |
| | 108 | │ │ │ │ │ │ │ │ │ │ ... |
| 98 | │ │ │ │ │ │ │ │ ... | 109 | │ │ │ │ │ │ │ │ ... |
| 99 | │ │ │ │ │ │ ... | 110 | │ │ │ │ │ │ ... |
| 100 | │ │ │ │ ... | 111 | │ │ │ │ ... |
| @@ -194,9 +205,9 @@ details). At the moment, only one context per kdamond is supported, so only · 93 unmodified lines |
| 194 | contexts/<N>/ | 205 | contexts/<N>/ |
| 195 | ------------- | 206 | ------------- |
| 196 | | 207 | |
| 197 | In each context directory, three files (``avail_operations``, ``operations`` | 208 | In each context directory, four files (``avail_operations``, ``operations``, |
| 198 | and ``addr_unit``) and three directories (``monitoring_attrs``, ``targets``, | 209 | ``addr_unit`` and ``pause``) and three directories (``monitoring_attrs``, |
| 199 | and ``schemes``) exist. | 210 | ``targets``, and ``schemes``) exist. |
| 200 | | 211 | |
| 201 | DAMON supports multiple types of :ref:`monitoring operations | 212 | DAMON supports multiple types of :ref:`monitoring operations |
| 202 | <damon_design_configurable_operations_set>`, including those for virtual address | 213 | <damon_design_configurable_operations_set>`, including those for virtual address |
| @@ -214,6 +225,9 @@ reading from the ``operations`` file. · 11 unmodified lines |
| 214 | ``addr_unit`` file is for setting and getting the :ref:`address unit | 225 | ``addr_unit`` file is for setting and getting the :ref:`address unit |
| 215 | <damon_design_addr_unit>` parameter of the operations set. | 226 | <damon_design_addr_unit>` parameter of the operations set. |
| 216 | | 227 | |
| | 228 | ``pause`` file is for setting and getting the :ref:`pause request |
| | 229 | <damon_design_execution_model_and_data_structures>` parameter of the context. |
| | 230 | |
| 217 | .. _sysfs_monitoring_attrs: | 231 | .. _sysfs_monitoring_attrs: |
| 218 | | 232 | |
| 219 | contexts/<N>/monitoring_attrs/ | 233 | contexts/<N>/monitoring_attrs/ |
| @@ -221,8 +235,8 @@ contexts/<N>/monitoring_attrs/ · 1 unmodified line |
| 221 | | 235 | |
| 222 | Files for specifying attributes of the monitoring including required quality | 236 | Files for specifying attributes of the monitoring including required quality |
| 223 | and efficiency of the monitoring are in ``monitoring_attrs`` directory. | 237 | and efficiency of the monitoring are in ``monitoring_attrs`` directory. |
| 224 | Specifically, two directories, ``intervals`` and ``nr_regions`` exist in this | 238 | Specifically, three directories, ``intervals``, ``nr_regions`` and ``probes`` |
| 225 | directory. | 239 | exist in this directory. |
| 226 | | 240 | |
| 227 | Under ``intervals`` directory, three files for DAMON's sampling interval | 241 | Under ``intervals`` directory, three files for DAMON's sampling interval |
| 228 | (``sample_us``), aggregation interval (``aggr_us``), and update interval | 242 | (``sample_us``), aggregation interval (``aggr_us``), and update interval |
| @@ -256,6 +270,29 @@ tuning-applied current values of the two intervals can be read from the · 27 unmodified lines |
| 256 | ``sample_us`` and ``aggr_us`` files after writing ``update_tuned_intervals`` to | 270 | ``sample_us`` and ``aggr_us`` files after writing ``update_tuned_intervals`` to |
| 257 | the ``state`` file. | 271 | the ``state`` file. |
| 258 | | 272 | |
| | 273 | .. _damon_usage_sysfs_probes: |
| | 274 | |
| | 275 | contexts/<N>/monitoring_attrs/probes/ |
| | 276 | ------------------------------------- |
| | 277 | |
| | 278 | A directory for registering :ref:`data attributes monitoring |
| | 279 | <damon_design_data_attrs_monitoring>` probes. |
| | 280 | |
| | 281 | In the beginning, this directory has only one file, ``nr_probes``. Writing a |
| | 282 | number (``N``) to the file creates the number of child directories named ``0`` |
| | 283 | to ``N-1``. Each directory represents each monitoring probe. |
| | 284 | |
| | 285 | In each probe directory, one directory, ``filters`` exists. The directory |
| | 286 | contains files for installing filters for the probe, that is used to determine |
| | 287 | the data attribute for the probe. |
| | 288 | |
| | 289 | In the beginning, ``filters`` directory has only one file, ``nr_filters``. |
| | 290 | Writing a number (``N``) to the file creates the number of child directories |
| | 291 | named ``0`` to ``N-1``. Each directory represents each filter and works in a |
| | 292 | way similar to that for :ref:`DAMOS filter <sysfs_filters>`. When the filter |
| | 293 | ``type`` is ``memcg``, ``path`` file acts as ``memcg_path`` for :ref:`DAMOS |
| | 294 | filter <sysfs_filters>`. |
| | 295 | |
| 259 | .. _sysfs_targets: | 296 | .. _sysfs_targets: |
| 260 | | 297 | |
| 261 | contexts/<N>/targets/ | 298 | contexts/<N>/targets/ |
| @@ -337,7 +374,7 @@ to ``N-1``. Each directory represents each DAMON-based operation scheme. · 75 unmodified lines |
| 337 | schemes/<N>/ | 374 | schemes/<N>/ |
| 338 | ------------ | 375 | ------------ |
| 339 | | 376 | |
| 340 | In each scheme directory, eight directories (``access_pattern``, ``quotas``, | 377 | In each scheme directory, nine directories (``access_pattern``, ``quotas``, |
| 341 | ``watermarks``, ``core_filters``, ``ops_filters``, ``filters``, ``dests``, | 378 | ``watermarks``, ``core_filters``, ``ops_filters``, ``filters``, ``dests``, |
| 342 | ``stats``, and ``tried_regions``) and three files (``action``, ``target_nid`` | 379 | ``stats``, and ``tried_regions``) and three files (``action``, ``target_nid`` |
| 343 | and ``apply_interval``) exist. | 380 | and ``apply_interval``) exist. |
| @@ -377,9 +414,10 @@ schemes/<N>/quotas/ · 33 unmodified lines |
| 377 | The directory for the :ref:`quotas <damon_design_damos_quotas>` of the given | 414 | The directory for the :ref:`quotas <damon_design_damos_quotas>` of the given |
| 378 | DAMON-based operation scheme. | 415 | DAMON-based operation scheme. |
| 379 | | 416 | |
| 380 | Under ``quotas`` directory, five files (``ms``, ``bytes``, | 417 | Under ``quotas`` directory, seven files (``ms``, ``bytes``, |
| 381 | ``reset_interval_ms``, ``effective_bytes`` and ``goal_tuner``) and two | 418 | ``reset_interval_ms``, ``effective_bytes``, ``goal_tuner``, ``fail_charge_num`` |
| 382 | directories (``weights`` and ``goals``) exist. | 419 | and ``fail_charge_denom``) and two directories (``weights`` and ``goals``) |
| | 420 | exist. |
| 383 | | 421 | |
| 384 | You can set the ``time quota`` in milliseconds, ``size quota`` in bytes, and | 422 | You can set the ``time quota`` in milliseconds, ``size quota`` in bytes, and |
| 385 | ``reset interval`` in milliseconds by writing the values to the three files, | 423 | ``reset interval`` in milliseconds by writing the values to the three files, |
| @@ -398,6 +436,13 @@ the background design of the feature and the name of the selectable algorithms. · 12 unmodified lines |
| 398 | Refer to :ref:`goals directory <sysfs_schemes_quota_goals>` for the goals | 436 | Refer to :ref:`goals directory <sysfs_schemes_quota_goals>` for the goals |
| 399 | setup. | 437 | setup. |
| 400 | | 438 | |
| | 439 | You can set the action-failed memory quota charging ratio by writing the |
| | 440 | numerator and the denominator for the ratio to ``fail_charge_num`` and |
| | 441 | ``fail_charge_denom`` files, respectively. Reading those files will return the |
| | 442 | current set values. Refer to :ref:`design |
| | 443 | <damon_design_damos_quotas_failed_memory_charging_ratio>` for more details of |
| | 444 | the ratio feature. |
| | 445 | |
| 401 | The time quota is internally transformed to a size quota. Between the | 446 | The time quota is internally transformed to a size quota. Between the |
| 402 | transformed size quota and user-specified size quota, smaller one is applied. | 447 | transformed size quota and user-specified size quota, smaller one is applied. |
| 403 | Based on the user-specified :ref:`goal <sysfs_schemes_quota_goals>`, the | 448 | Based on the user-specified :ref:`goal <sysfs_schemes_quota_goals>`, the |
| @@ -429,10 +474,12 @@ to ``N-1``. Each directory represents each goal and current achievement. · 25 unmodified lines |
| 429 | Among the multiple feedback, the best one is used. | 474 | Among the multiple feedback, the best one is used. |
| 430 | | 475 | |
| 431 | Each goal directory contains five files, namely ``target_metric``, | 476 | Each goal directory contains five files, namely ``target_metric``, |
| 432 | ``target_value``, ``current_value`` ``nid`` and ``path``. Users can set and | 477 | ``target_value``, ``current_value``, ``nid``, and ``path``. Users can set and |
| 433 | get the five parameters for the quota auto-tuning goals that specified on the | 478 | get the five parameters for the quota auto-tuning goals that specified on the |
| 434 | :ref:`design doc <damon_design_damos_quotas_auto_tuning>` by writing to and | 479 | :ref:`design doc <damon_design_damos_quotas_auto_tuning>` by writing to and |
| 435 | reading from each of the files. Note that users should further write | 480 | reading from each of the files. Because the kernel does not update |
| | 481 | ``current_value``, reading it only makes sense when ``target_metric`` is |
| | 482 | ``user_input``. Note that users should further write |
| 436 | ``commit_schemes_quota_goals`` to the ``state`` file of the :ref:`kdamond | 483 | ``commit_schemes_quota_goals`` to the ``state`` file of the :ref:`kdamond |
| 437 | directory <sysfs_kdamond>` to pass the feedback to DAMON. | 484 | directory <sysfs_kdamond>` to pass the feedback to DAMON. |
| 438 | | 485 | |
| @@ -447,7 +494,7 @@ given DAMON-based operation scheme. · 8 unmodified lines |
| 447 | Under the watermarks directory, five files (``metric``, ``interval_us``, | 494 | Under the watermarks directory, five files (``metric``, ``interval_us``, |
| 448 | ``high``, ``mid``, and ``low``) for setting the metric, the time interval | 495 | ``high``, ``mid``, and ``low``) for setting the metric, the time interval |
| 449 | between check of the metric, and the three watermarks exist. You can set and | 496 | between check of the metric, and the three watermarks exist. You can set and |
| 450 | get the five values by writing to the files, respectively. | 497 | get the five values by writing to and reading from the files, respectively. |
| 451 | | 498 | |
| 452 | Keywords and meanings of those that can be written to the ``metric`` file are | 499 | Keywords and meanings of those that can be written to the ``metric`` file are |
| 453 | as below. | 500 | as below. |
| @@ -455,7 +502,7 @@ as below. · 1 unmodified line |
| 455 | - none: Ignore the watermarks | 502 | - none: Ignore the watermarks |
| 456 | - free_mem_rate: System's free memory rate (per thousand) | 503 | - free_mem_rate: System's free memory rate (per thousand) |
| 457 | | 504 | |
| 458 | The ``interval`` should written in microseconds unit. | 505 | The ``interval_us`` should be written in microseconds unit. |
| 459 | | 506 | |
| 460 | .. _sysfs_filters: | 507 | .. _sysfs_filters: |
| 461 | | 508 | |
| @@ -471,10 +518,10 @@ directory can be used for installing filters regardless of their handled · 9 unmodified lines |
| 471 | layers. Filters that requested by ``core_filters`` and ``ops_filters`` will be | 518 | layers. Filters that requested by ``core_filters`` and ``ops_filters`` will be |
| 472 | installed before those of ``filters``. All three directories have same files. | 519 | installed before those of ``filters``. All three directories have same files. |
| 473 | | 520 | |
| 474 | Use of ``filters`` directory can make expecting evaluation orders of given | 521 | Use of ``filters`` directory can make filters evaluation orders confusing to |
| 475 | filters with the files under directory bit confusing. Users are hence | 522 | expect. For this reason, ``filters`` directory is deprecated. It is still |
| 476 | recommended to use ``core_filters`` and ``ops_filters`` directories. The | 523 | functioning, but is scheduled for removal in the near future. Users should use |
| 477 | ``filters`` directory could be deprecated in future. | 524 | ``core_filters`` and ``ops_filters`` directories instead. |
| 478 | | 525 | |
| 479 | In the beginning, the directory has only one file, ``nr_filters``. Writing a | 526 | In the beginning, the directory has only one file, ``nr_filters``. Writing a |
| 480 | number (``N``) to the file creates the number of child directories named ``0`` | 527 | number (``N``) to the file creates the number of child directories named ``0`` |
| @@ -483,9 +530,9 @@ in the numeric order. · 2 unmodified lines |
| 483 | | 530 | |
| 484 | Each filter directory contains nine files, namely ``type``, ``matching``, | 531 | Each filter directory contains nine files, namely ``type``, ``matching``, |
| 485 | ``allow``, ``memcg_path``, ``addr_start``, ``addr_end``, ``min``, ``max`` | 532 | ``allow``, ``memcg_path``, ``addr_start``, ``addr_end``, ``min``, ``max`` |
| 486 | and ``target_idx``. To ``type`` file, you can write the type of the filter. | 533 | and ``damon_target_idx``. To ``type`` file, you can write the type of the |
| 487 | Refer to :ref:`the design doc <damon_design_damos_filters>` for available type | 534 | filter. Refer to :ref:`the design doc <damon_design_damos_filters>` for |
| 488 | names, their meaning and on what layer those are handled. | 535 | available type names, their meaning and on what layer those are handled. |
| 489 | | 536 | |
| 490 | For ``memcg`` type, you can specify the memory cgroup of the interest by | 537 | For ``memcg`` type, you can specify the memory cgroup of the interest by |
| 491 | writing the path of the memory cgroup from the cgroups mount point to | 538 | writing the path of the memory cgroup from the cgroups mount point to |
| @@ -495,7 +542,7 @@ files, respectively. For ``hugepage_size`` type, you can specify the minimum · 3 unmodified lines |
| 495 | and maximum size of the range (closed interval) to ``min`` and ``max`` files, | 542 | and maximum size of the range (closed interval) to ``min`` and ``max`` files, |
| 496 | respectively. For ``target`` type, you can specify the index of the target | 543 | respectively. For ``target`` type, you can specify the index of the target |
| 497 | between the list of the DAMON context's monitoring targets list to | 544 | between the list of the DAMON context's monitoring targets list to |
| 498 | ``target_idx`` file. | 545 | ``damon_target_idx`` file. |
| 499 | | 546 | |
| 500 | You can write ``Y`` or ``N`` to ``matching`` file to specify whether the filter | 547 | You can write ``Y`` or ``N`` to ``matching`` file to specify whether the filter |
| 501 | is for memory that matches the ``type``. You can write ``Y`` or ``N`` to | 548 | is for memory that matches the ``type``. You can write ``Y`` or ``N`` to |
| @@ -601,10 +648,19 @@ tried_regions/<N>/ · 99 unmodified lines |
| 601 | ------------------ | 648 | ------------------ |
| 602 | | 649 | |
| 603 | In each region directory, you will find five files (``start``, ``end``, | 650 | In each region directory, you will find five files (``start``, ``end``, |
| 604 | ``nr_accesses``, ``age``, and ``sz_filter_passed``). Reading the files will | 651 | ``nr_accesses``, ``age`` and ``sz_filter_passed``). Reading the files will |
| 605 | show the properties of the region that corresponding DAMON-based operation | 652 | show the properties of the region that corresponding DAMON-based operation |
| 606 | scheme ``action`` has tried to be applied. | 653 | scheme ``action`` has tried to be applied. |
| 607 | | 654 | |
| | 655 | tried_regions/<N>/probes/ |
| | 656 | ------------------------- |
| | 657 | |
| | 658 | In each region directory, one directory (``probes``) also exists. In the |
| | 659 | directory, subdirectories named ``0`` to ``N-1`` exists. ``N`` is the number |
| | 660 | of installed probes. In each number-named directory, a file (``hits``) exist. |
| | 661 | Reading the file shows the number of data attributes monitoring probe-hit |
| | 662 | positive samples of the region. |
| | 663 | |
| 608 | Example | 664 | Example |
| 609 | ~~~~~~~ | 665 | ~~~~~~~ |
| 610 | | 666 | |
| @@ -677,7 +733,7 @@ show results using tracepoint supporting tools like ``perf``. For example:: · 66 unmodified lines |
| 677 | | 733 | |
| 678 | Each line of the perf script output represents each monitoring region. The | 734 | Each line of the perf script output represents each monitoring region. The |
| 679 | first five fields are as usual other tracepoint outputs. The sixth field | 735 | first five fields are as usual other tracepoint outputs. The sixth field |
| 680 | (``target_id=X``) shows the ide of the monitoring target of the region. The | 736 | (``target_id=X``) shows the id of the monitoring target of the region. The |
| 681 | seventh field (``nr_regions=X``) shows the total number of monitoring regions | 737 | seventh field (``nr_regions=X``) shows the total number of monitoring regions |
| 682 | for the target. The eighth field (``X-Y:``) shows the start (``X``) and end | 738 | for the target. The eighth field (``X-Y:``) shows the start (``X``) and end |
| 683 | (``Y``) addresses of the region in bytes. The ninth field (``X``) shows the | 739 | (``Y``) addresses of the region in bytes. The ninth field (``X``) shows the |