History

Merge tag 'mm-stable-2026-06-18-09-26' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Pull MM updates from Andrew Morton: - "selftests/mm: clean up build output and verbosity" (Li Wang) Remove some noise from the MM selftests build - "mm: Free contiguous order-0 pages efficiently" (Ryan Roberts) Speed up the freeing of a batch of 0-order pages by first scanning them for coalescing opportunities. This is applicable to vfree() and to the releasing of frozen pages - "mm/damon: introduce DAMOS failed region quota charge ratio" (SeongJae Park) Address a DAMOS usability issue: The DAMOS quota often exhausts prematurely because it charges for all memory attempted, causing slow and inconsistent performance when actions fail on unreclaimable memory. To fix this, a new feature lets users set a smaller, flexible quota charge ratio (via a numerator and denominator) for failed regions. Since failed actions cause less overhead, reducing their quota cost ensures more predictable and efficient DAMOS processing - "selftests/cgroup: improve zswap tests robustness and support large page sizes" (Li Wang) Fix various spurious failures and improves the overall robustness of the cgroup zswap selftests - "fix MAP_DROPPABLE not supported errno" (Anthony Yznaga) Fix an issue in the mlock selftests on arm32 - "mm: huge_memory: clean up defrag sysfs with shared" (Breno Leitao) Some maintenance work in the huge_memory code - "treewide: fixup gfp_t printks" (Brendan Jackman) Use the special vprintf() gfp_t conversion in various places - "mm: Fix vmemmap optimization accounting and initialization" (Muchun Song) Fix several bugs in the vmemmap optimization, mainly around incorrect page accounting and memmap initialization in the DAX and memory hotplug paths. It also fixes pageblock migratetype initialization and struct page initialization for ZONE_DEVICE compound pages - "mm/damon: repost non-hotfix reviewed patches in damon/next tree" A sprinkle of unrelated minor bugfixes for DAMON - "mm: remove page_mapped()" (David Hildenbrand) Remove this function from the tree, replacing it with folio_mapped() - "mm/damon: let DAMON be paused and resumed" (SeongJae Park) Allow DAMON to be paused and resumed without losing its current state - "kasan: hw_tags: Disable tagging for stack and page-tables" (Muhammad Usama Anjum) Simplify and speed up kasan by removing its ineffective tagging of stacks and page tables - "mm/damon/reclaim,lru_sort: monitor all system rams by default" (SeongJae Park) Simplify deployment on diverse hardware like NUMA systems by updating DAMON_RECLAIM and DAMON_LRU_SORT to automatically monitor the physical address range covering all System RAM areas by default, replacing the overly restrictive behavior that only targeted the single largest memory block to save on negligible overhead - "mm/damon/sysfs: document filters/ directory as deprecated" (SeongJae Park) Update some DAMON docs - "mm: use spinlock guards for zone lock" (Dmitry Ilvokhin) Switch zone->lock handling over to using the guard() mechanisms - "mm/filemap: tighten mmap_miss hit accounting" (fujunjie) Fix a flaw where the mmap_miss counter over-credited page cache hits during fault-arounds and page-fault retries. This results in significant reduction of redundant synchronous mmap readahead I/O, drastically cutting down execution time and gigabytes read for sparse random or strided memory access workloads - "selftests/cgroup: Fix false positive failures in test_percpu_basic" (Li Wang) Fix a couple of false-positives in the cgroup kmem selftests - "mm/damon/reclaim: support monitoring intervals auto-tuning" (SeongJae Park) Add a new parameter to DAMON permitting DAMON_RECLAIM to automatically tune DAMON's sampling and aggregation intervals - "mm/damon/stat: add kdamond_pid parameter" (SeongJae Park) Change DAMON_STAT to provide the pid of its kdamond - "mm/kmemleak: dedupe verbose scan output" (Breno Leitao) Remove large amounts of duplicated backtraces from the verbose-mode kmemleak output - "mm: remove CONFIG_HAVE_BOOTMEM_INFO_NODE (Part 1)" (David Hildenbrand) Reduce our use of CONFIG_HAVE_BOOTMEM_INFO_NODE, with a view to removing it entirely in a later series - "mm/damon: validate min_region_size to be power of 2" (Liew Rui Yan) Prevent users from passing a non-power-of-2 value of `addr_unit', as this later results in undesirable behavior - "mm: document read_pages and simplify usage" (Frederick Mayle) - "tools/mm/page-types: Fix misc bugs" (Ye Liu) Fix three issues in tools/mm/page-types.c - "mm: misc cleanups from __GFP_UNMAPPED series" (Brendan Jackman) Implement several cleanups in the page allocator and related code - "mm, swap: swap table phase IV: unify allocation" (Kairui Song) Unify the allocation and charging of anon and shmem swap in folios, provides better synchronization, consolidates the metadata management, hence dropping the static array and map, and improves performance - "mm/damon: introduce data attributes monitoring" (SeongJae Park( Extend DAMON to monitor general data attributes other than accesses - "mm/vmalloc: free unused pages on vrealloc() shrink" (Shivam Kalra) Implement the TODO in vrealloc() to unmap and free unused pages when shrinking across a page boundary - "mm/damon: documentation and comment fixes" (niecheng) - "remove mmap_action success, error hooks" (Lorenzo Stoakes) Eliminate custom hooks from mmap_action by removing the problematic success_hook which allowed drivers to improperly access uninitialized VMAs. It replaces the error_hook with a simple error-code field and updates the memory char driver accordingly - "mm/damon: minor improvements for code readability and tests" (SeongJae Park) - "mm/damon: fix macro arguments and clarify quota goals doc" (Maksym Shcherba) - "userfaultfd: merge fs/userfaultfd.c into mm/userfaultfd.c" (Mike Rapoport) - "mm/mglru: improve reclaim loop and dirty folio" (Kairui Song and others) Clean up and slightly improves MGLRU's reclaim loop and dirty writeback handling. Large performance improvements are measured - "use vma locks for proc/pid/{smaps|numa_maps} reads" (Suren Baghdasaryan) Use per-vma locks when reading /proc/pid/smaps and numa_maps similar to reduce contention on central mmap_lock - "refactors thpsize_shmem_enabled_store() and thpsize_shmem_enabled_show()" (Ran Xiaokai) Some cleanup work in the THP code - "selftests/memfd: fix compilation warnings" (Konstantin Khorenko) Fix a few build glitches in the memfd selftest code. - "memcg: shrink obj_stock_pcp and cache multiple objcgs" (Shakeel Butt) Resolve a 68% performance regression caused by NUMA-node cache thrashing around struct obj_stock_pcp by shrinking its existing fields and expanding it into a multi-slot array that caches up to five obj_cgroup pointers per CPU, allowing per-node variants of the same memcg to coexist within a single 64-byte cache line. - "zram: writeback fixes" (Sergey Senozhatsky) address a couple of unrelated zram writeback issues - "mm: switch THP shrinker to list_lru" (Johannes Weiner) Resolve NUMA-awareness issues and streamlines callsite interaction by refactoring and extending the list_lru API to completely replace the complex, open-coded deferred split queue for Transparent Huge Pages - "mm: improve large folio readahead for exec memory" (Usama Arif) Improve large-folio readahead on systems like 64K-page arm64 by preventing the mmap_miss check from permanently disabling target-oriented VM_EXEC readahead, and by generalizing the force_thp_readahead gate to support mappings with any usefully large maximum folio order under the cache cap. - "userfaultfd/pagemap: pre-existing fixes" (Kiryl Shutsemau) Fix a bunch of minor issues in the userfaultfd/pagemap, all of which were flagged by Sashiko review of proposed new material - "mm/sparse-vmemmap: Provide generic vmemmap_set_pmd() and vmemmap_check_pmd()" (Muchun Song) Provide generic versions of these two functions so the four arch-specific implementations can be removed. - "mm/swap, PM: hibernate: fix swapoff race in uswsusp by pinning swap device" (Youngjun Park) Address a uswsusp-vs-swapoff race and reduces the swap device reference taking/releasing frequency. - "mm/hmm: A fix and a selftest" (Dev Jain) * tag 'mm-stable-2026-06-18-09-26' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (321 commits) selftests/mm/hmm-tests: test pagemap reads of PMD device-private entries fs/proc/task_mmu: do not warn on seeing non-migration pmd entry lib/test_hmm: check alloc_page_vma() return value and handle OOM mm/compaction: cap compact_gap() at COMPACT_CLUSTER_MAX mm/swap: remove redundant swap device reference in alloc/free mm/swap, PM: hibernate: fix swapoff race in uswsusp by pinning swap device mm/filemap: use folio_next_index() for start vmalloc: fix NULL pointer dereference in is_vm_area_hugepages() sparc/mm: drop vmemmap_check_pmd helper and use generic code loongarch/mm: drop vmemmap_check_pmd helper and use generic code riscv/mm: drop vmemmap_pmd helpers and use generic code arm64/mm: drop vmemmap_pmd helpers and use generic code mm/sparse-vmemmap: provide generic vmemmap_set_pmd() and vmemmap_check_pmd() rust: page: mark Page::nid as inline userfaultfd: build __VMA_UFFD_FLAGS from config-gated masks userfaultfd: gate must_wait writability check on pte_present() mm/huge_memory: preserve pmd_swp_uffd_wp on device-private PMD downgrade fs/proc/task_mmu: fix hugetlb self-deadlock in pagemap_scan_pte_hole() fs/proc/task_mmu: use huge_page_size() in pagemap_scan_hugetlb_entry() fs/proc/task_mmu: fix make_uffd_wp_huge_pte() prot-update race ...

Linus Torvalds committed 4 months ago

Commit a552c812 parents c98d767 e3d8707169 files · +9215 −5618Browse files

Showing the changes to Documentation/admin-guide (7 of 169 files). Show all

Unified · Split

7 files
  1. Documentation/admin-guide/kernel-parameters.txt +4 −0
  2. Documentation/admin-guide/mm/damon/lru_sort.rst +5 −3
  3. Documentation/admin-guide/mm/damon/reclaim.rst +16 −3
  4. Documentation/admin-guide/mm/damon/stat.rst +7 −0
  5. Documentation/admin-guide/mm/damon/usage.rst +82 −26
  6. Documentation/admin-guide/mm/transhuge.rst +2 −2
  7. Documentation/admin-guide/sysctl/vm.rst +2 −0
Documentation/admin-guide/kernel-parameters.txt+4−0
@@ -2067,6 +2067,10 @@ Kernel parameters · 2066 unmodified lines
2067 Format: nn[KMGTPE] or (node format)2067 Format: nn[KMGTPE] or (node format)
2068 <node>:nn[KMGTPE][,<node>:nn[KMGTPE]]2068 <node>:nn[KMGTPE][,<node>:nn[KMGTPE]]
2069 2069
2070 The size must be a multiple of the gigantic page size.
2071 When using node format, this applies to each per-node size.
2072 Missaligned values are dropped with a warning.
2073
2070 Reserve a CMA area of given size and allocate gigantic2074 Reserve a CMA area of given size and allocate gigantic
2071 hugepages using the CMA allocator. If enabled, the2075 hugepages using the CMA allocator. If enabled, the
2072 boot-time allocation of gigantic hugepages is skipped.2076 boot-time allocation of gigantic hugepages is skipped.
Documentation/admin-guide/mm/damon/lru_sort.rst+5−3
@@ -75,7 +75,7 @@ Make DAMON_LRU_SORT reads the input parameters again, except ``enabled``. · 74 unmodified lines
75 75
76Input parameters that updated while DAMON_LRU_SORT is running are not applied76Input parameters that updated while DAMON_LRU_SORT is running are not applied
77by default. Once this parameter is set as ``Y``, DAMON_LRU_SORT reads values77by default. Once this parameter is set as ``Y``, DAMON_LRU_SORT reads values
78of parametrs except ``enabled`` again. Once the re-reading is done, this78of parameters except ``enabled`` again. Once the re-reading is done, this
79parameter is set as ``N``. If invalid parameters are found while the79parameter is set as ``N``. If invalid parameters are found while the
80re-reading, DAMON_LRU_SORT will be disabled.80re-reading, DAMON_LRU_SORT will be disabled.
81 81
@@ -246,7 +246,8 @@ monitor_region_start · 164 unmodified lines
246Start of target memory region in physical address.246Start of target memory region in physical address.
247 247
248The start physical address of memory region that DAMON_LRU_SORT will do work248The start physical address of memory region that DAMON_LRU_SORT will do work
249against. By default, biggest System RAM is used as the region.249against. By default, the system's entire physical memory is used as the
250region.
250 251
251monitor_region_end252monitor_region_end
252------------------253------------------
@@ -254,7 +255,8 @@ monitor_region_end · 1 unmodified line
254End of target memory region in physical address.255End of target memory region in physical address.
255 256
256The end physical address of memory region that DAMON_LRU_SORT will do work257The end physical address of memory region that DAMON_LRU_SORT will do work
257against. By default, biggest System RAM is used as the region.258against. By default, the system's entire physical memory is used as the
259region.
258 260
259addr_unit261addr_unit
260---------262---------
Documentation/admin-guide/mm/damon/reclaim.rst+16−3
@@ -67,7 +67,7 @@ Make DAMON_RECLAIM reads the input parameters again, except ``enabled``. · 66 unmodified lines
67 67
68Input parameters that updated while DAMON_RECLAIM is running are not applied68Input parameters that updated while DAMON_RECLAIM is running are not applied
69by default. Once this parameter is set as ``Y``, DAMON_RECLAIM reads values69by default. Once this parameter is set as ``Y``, DAMON_RECLAIM reads values
70of parametrs except ``enabled`` again. Once the re-reading is done, this70of parameters except ``enabled`` again. Once the re-reading is done, this
71parameter is set as ``N``. If invalid parameters are found while the71parameter is set as ``N``. If invalid parameters are found while the
72re-reading, DAMON_RECLAIM will be disabled.72re-reading, DAMON_RECLAIM will be disabled.
73 73
@@ -85,6 +85,17 @@ identifies the region as cold, and reclaims it. · 11 unmodified lines
85 85
86120 seconds by default.86120 seconds by default.
87 87
88autotune_monitoring_intervals
89-----------------------------
90
91If this parameter is set as ``Y``, DAMON_RECLAIM automatically tunes DAMON's
92sampling and aggregation intervals. The auto-tuning aims to capture meaningful
93amount of access events in each DAMON-snapshot, while keeping the sampling
94interval 5 milliseconds in minimum, and 10 seconds in maximum. Setting this as
95``N`` disables the auto-tuning.
96
97Disabled by default.
98
88quota_ms99quota_ms
89--------100--------
90 101
@@ -229,7 +240,8 @@ Start of target memory region in physical address. · 138 unmodified lines
229 240
230The start physical address of memory region that DAMON_RECLAIM will do work241The start physical address of memory region that DAMON_RECLAIM will do work
231against. That is, DAMON_RECLAIM will find cold memory regions in this region242against. That is, DAMON_RECLAIM will find cold memory regions in this region
232and reclaims. By default, biggest System RAM is used as the region.243and reclaims. By default, the system's entire physical memory is used as the
244region.
233 245
234monitor_region_end246monitor_region_end
235------------------247------------------
@@ -238,7 +250,8 @@ End of target memory region in physical address. · 2 unmodified lines
238 250
239The end physical address of memory region that DAMON_RECLAIM will do work251The end physical address of memory region that DAMON_RECLAIM will do work
240against. That is, DAMON_RECLAIM will find cold memory regions in this region252against. That is, DAMON_RECLAIM will find cold memory regions in this region
241and reclaims. By default, biggest System RAM is used as the region.253and reclaims. By default, the system's entire physical memory is used as the
254region.
242 255
243addr_unit256addr_unit
244---------257---------
Documentation/admin-guide/mm/damon/stat.rst+7−0
@@ -89,3 +89,10 @@ percentiles of the idle time values via this read-only parameter. Reading the · 88 unmodified lines
89parameter returns 101 idle time values in milliseconds, separated by comma.89parameter returns 101 idle time values in milliseconds, separated by comma.
90Each value represents 0-th, 1st, 2nd, 3rd, ..., 99th and 100th percentile idle90Each value represents 0-th, 1st, 2nd, 3rd, ..., 99th and 100th percentile idle
91times.91times.
92
93kdamond_pid
94-----------
95
96PID of the DAMON thread.
97
98If DAMON_STAT is enabled, this becomes the PID of the worker thread. Else, -1.
Documentation/admin-guide/mm/damon/usage.rst+82−26
@@ -66,11 +66,17 @@ comma (","). · 65 unmodified lines
66 │ :ref:`kdamonds <sysfs_kdamonds>`/nr_kdamonds66 │ :ref:`kdamonds <sysfs_kdamonds>`/nr_kdamonds
67 │ │ :ref:`0 <sysfs_kdamond>`/state,pid,refresh_ms67 │ │ :ref:`0 <sysfs_kdamond>`/state,pid,refresh_ms
68 │ │ │ :ref:`contexts <sysfs_contexts>`/nr_contexts68 │ │ │ :ref:`contexts <sysfs_contexts>`/nr_contexts
69 │ │ │ │ :ref:`0 <sysfs_context>`/avail_operations,operations,addr_unit69 │ │ │ │ :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_us72 │ │ │ │ │ │ intervals/sample_us,aggr_us,update_us
72 │ │ │ │ │ │ │ intervals_goal/access_bp,aggrs,min_sample_us,max_sample_us73 │ │ │ │ │ │ │ intervals_goal/access_bp,aggrs,min_sample_us,max_sample_us
73 │ │ │ │ │ │ nr_regions/min,max74 │ │ │ │ │ │ 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_targets80 │ │ │ │ │ :ref:`targets <sysfs_targets>`/nr_targets
75 │ │ │ │ │ │ :ref:`0 <sysfs_target>`/pid_target,obsolete_target81 │ │ │ │ │ │ :ref:`0 <sysfs_target>`/pid_target,obsolete_target
76 │ │ │ │ │ │ │ :ref:`regions <sysfs_regions>`/nr_regions82 │ │ │ │ │ │ │ :ref:`regions <sysfs_regions>`/nr_regions
@@ -83,18 +89,23 @@ comma (","). · 6 unmodified lines
83 │ │ │ │ │ │ │ │ sz/min,max89 │ │ │ │ │ │ │ │ sz/min,max
84 │ │ │ │ │ │ │ │ nr_accesses/min,max90 │ │ │ │ │ │ │ │ nr_accesses/min,max
85 │ │ │ │ │ │ │ │ age/min,max91 │ │ │ │ │ │ │ │ age/min,max
86 │ │ │ │ │ │ │ :ref:`quotas <sysfs_quotas>`/ms,bytes,reset_interval_ms,effective_bytes,goal_tuner92 │ │ │ │ │ │ │ :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_permil95 │ │ │ │ │ │ │ │ weights/sz_permil,nr_accesses_permil,age_permil
88 │ │ │ │ │ │ │ │ :ref:`goals <sysfs_schemes_quota_goals>`/nr_goals96 │ │ │ │ │ │ │ │ :ref:`goals <sysfs_schemes_quota_goals>`/nr_goals
89 │ │ │ │ │ │ │ │ │ 0/target_metric,target_value,current_value,nid,path97 │ │ │ │ │ │ │ │ │ 0/target_metric,target_value,current_value,nid,path
90 │ │ │ │ │ │ │ :ref:`watermarks <sysfs_watermarks>`/metric,interval_us,high,mid,low98 │ │ │ │ │ │ │ :ref:`watermarks <sysfs_watermarks>`/metric,interval_us,high,mid,low
91 │ │ │ │ │ │ │ :ref:`{core_,ops_,}filters <sysfs_filters>`/nr_filters99 │ │ │ │ │ │ │ :ref:`{core_,ops_,}filters <sysfs_filters>`/nr_filters
92 │ │ │ │ │ │ │ │ 0/type,matching,allow,memcg_path,addr_start,addr_end,target_idx,min,max100 │ │ │ │ │ │ │ │ 0/type,matching,allow,memcg_path,addr_start,addr_end,damon_target_idx,min,max
93 │ │ │ │ │ │ │ :ref:`dests <damon_sysfs_dests>`/nr_dests101 │ │ │ │ │ │ │ :ref:`dests <damon_sysfs_dests>`/nr_dests
94 │ │ │ │ │ │ │ │ 0/id,weight102 │ │ │ │ │ │ │ │ 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_snapshots103 │ │ │ │ │ │ │ :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_bytes104 │ │ │ │ │ │ │ :ref:`tried_regions <sysfs_schemes_tried_regions>`/total_bytes
97 │ │ │ │ │ │ │ │ 0/start,end,nr_accesses,age,sz_filter_passed105 │ │ │ │ │ │ │ │ 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
194contexts/<N>/205contexts/<N>/
195-------------206-------------
196 207
197In each context directory, three files (``avail_operations``, ``operations``208In each context directory, four files (``avail_operations``, ``operations``,
198and ``addr_unit``) and three directories (``monitoring_attrs``, ``targets``,209``addr_unit`` and ``pause``) and three directories (``monitoring_attrs``,
199and ``schemes``) exist.210``targets``, and ``schemes``) exist.
200 211
201DAMON supports multiple types of :ref:`monitoring operations212DAMON supports multiple types of :ref:`monitoring operations
202<damon_design_configurable_operations_set>`, including those for virtual address213<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 unit225``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
219contexts/<N>/monitoring_attrs/233contexts/<N>/monitoring_attrs/
@@ -221,8 +235,8 @@ contexts/<N>/monitoring_attrs/ · 1 unmodified line
221 235
222Files for specifying attributes of the monitoring including required quality236Files for specifying attributes of the monitoring including required quality
223and efficiency of the monitoring are in ``monitoring_attrs`` directory.237and efficiency of the monitoring are in ``monitoring_attrs`` directory.
224Specifically, two directories, ``intervals`` and ``nr_regions`` exist in this238Specifically, three directories, ``intervals``, ``nr_regions`` and ``probes``
225directory.239exist in this directory.
226 240
227Under ``intervals`` directory, three files for DAMON's sampling interval241Under ``intervals`` directory, three files for DAMON's sampling interval
228(``sample_us``), aggregation interval (``aggr_us``), and update interval242(``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`` to270``sample_us`` and ``aggr_us`` files after writing ``update_tuned_intervals`` to
257the ``state`` file.271the ``state`` file.
258 272
273.. _damon_usage_sysfs_probes:
274
275contexts/<N>/monitoring_attrs/probes/
276-------------------------------------
277
278A directory for registering :ref:`data attributes monitoring
279<damon_design_data_attrs_monitoring>` probes.
280
281In the beginning, this directory has only one file, ``nr_probes``. Writing a
282number (``N``) to the file creates the number of child directories named ``0``
283to ``N-1``. Each directory represents each monitoring probe.
284
285In each probe directory, one directory, ``filters`` exists. The directory
286contains files for installing filters for the probe, that is used to determine
287the data attribute for the probe.
288
289In the beginning, ``filters`` directory has only one file, ``nr_filters``.
290Writing a number (``N``) to the file creates the number of child directories
291named ``0`` to ``N-1``. Each directory represents each filter and works in a
292way 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
294filter <sysfs_filters>`.
295
259.. _sysfs_targets:296.. _sysfs_targets:
260 297
261contexts/<N>/targets/298contexts/<N>/targets/
@@ -337,7 +374,7 @@ to ``N-1``. Each directory represents each DAMON-based operation scheme. · 75 unmodified lines
337schemes/<N>/374schemes/<N>/
338------------375------------
339 376
340In each scheme directory, eight directories (``access_pattern``, ``quotas``,377In 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``
343and ``apply_interval``) exist.380and ``apply_interval``) exist.
@@ -377,9 +414,10 @@ schemes/<N>/quotas/ · 33 unmodified lines
377The directory for the :ref:`quotas <damon_design_damos_quotas>` of the given414The directory for the :ref:`quotas <damon_design_damos_quotas>` of the given
378DAMON-based operation scheme.415DAMON-based operation scheme.
379 416
380Under ``quotas`` directory, five files (``ms``, ``bytes``,417Under ``quotas`` directory, seven files (``ms``, ``bytes``,
381``reset_interval_ms``, ``effective_bytes`` and ``goal_tuner``) and two418``reset_interval_ms``, ``effective_bytes``, ``goal_tuner``, ``fail_charge_num``
382directories (``weights`` and ``goals``) exist.419and ``fail_charge_denom``) and two directories (``weights`` and ``goals``)
420exist.
383 421
384You can set the ``time quota`` in milliseconds, ``size quota`` in bytes, and422You 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
398Refer to :ref:`goals directory <sysfs_schemes_quota_goals>` for the goals436Refer to :ref:`goals directory <sysfs_schemes_quota_goals>` for the goals
399setup.437setup.
400 438
439You can set the action-failed memory quota charging ratio by writing the
440numerator and the denominator for the ratio to ``fail_charge_num`` and
441``fail_charge_denom`` files, respectively. Reading those files will return the
442current set values. Refer to :ref:`design
443<damon_design_damos_quotas_failed_memory_charging_ratio>` for more details of
444the ratio feature.
445
401The time quota is internally transformed to a size quota. Between the446The time quota is internally transformed to a size quota. Between the
402transformed size quota and user-specified size quota, smaller one is applied.447transformed size quota and user-specified size quota, smaller one is applied.
403Based on the user-specified :ref:`goal <sysfs_schemes_quota_goals>`, the448Based 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
429Among the multiple feedback, the best one is used.474Among the multiple feedback, the best one is used.
430 475
431Each goal directory contains five files, namely ``target_metric``,476Each goal directory contains five files, namely ``target_metric``,
432``target_value``, ``current_value`` ``nid`` and ``path``. Users can set and477``target_value``, ``current_value``, ``nid``, and ``path``. Users can set and
433get the five parameters for the quota auto-tuning goals that specified on the478get 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 and479:ref:`design doc <damon_design_damos_quotas_auto_tuning>` by writing to and
435reading from each of the files. Note that users should further write480reading 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:`kdamond483``commit_schemes_quota_goals`` to the ``state`` file of the :ref:`kdamond
437directory <sysfs_kdamond>` to pass the feedback to DAMON.484directory <sysfs_kdamond>` to pass the feedback to DAMON.
438 485
@@ -447,7 +494,7 @@ given DAMON-based operation scheme. · 8 unmodified lines
447Under the watermarks directory, five files (``metric``, ``interval_us``,494Under the watermarks directory, five files (``metric``, ``interval_us``,
448``high``, ``mid``, and ``low``) for setting the metric, the time interval495``high``, ``mid``, and ``low``) for setting the metric, the time interval
449between check of the metric, and the three watermarks exist. You can set and496between check of the metric, and the three watermarks exist. You can set and
450get the five values by writing to the files, respectively.497get the five values by writing to and reading from the files, respectively.
451 498
452Keywords and meanings of those that can be written to the ``metric`` file are499Keywords and meanings of those that can be written to the ``metric`` file are
453as below.500as below.
@@ -455,7 +502,7 @@ as below. · 1 unmodified line
455 - none: Ignore the watermarks502 - 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
458The ``interval`` should written in microseconds unit.505The ``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
471layers. Filters that requested by ``core_filters`` and ``ops_filters`` will be518layers. Filters that requested by ``core_filters`` and ``ops_filters`` will be
472installed before those of ``filters``. All three directories have same files.519installed before those of ``filters``. All three directories have same files.
473 520
474Use of ``filters`` directory can make expecting evaluation orders of given521Use of ``filters`` directory can make filters evaluation orders confusing to
475filters with the files under directory bit confusing. Users are hence522expect. For this reason, ``filters`` directory is deprecated. It is still
476recommended to use ``core_filters`` and ``ops_filters`` directories. The523functioning, 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
479In the beginning, the directory has only one file, ``nr_filters``. Writing a526In the beginning, the directory has only one file, ``nr_filters``. Writing a
480number (``N``) to the file creates the number of child directories named ``0``527number (``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
484Each filter directory contains nine files, namely ``type``, ``matching``,531Each 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``
486and ``target_idx``. To ``type`` file, you can write the type of the filter.533and ``damon_target_idx``. To ``type`` file, you can write the type of the
487Refer to :ref:`the design doc <damon_design_damos_filters>` for available type534filter. Refer to :ref:`the design doc <damon_design_damos_filters>` for
488names, their meaning and on what layer those are handled.535available type names, their meaning and on what layer those are handled.
489 536
490For ``memcg`` type, you can specify the memory cgroup of the interest by537For ``memcg`` type, you can specify the memory cgroup of the interest by
491writing the path of the memory cgroup from the cgroups mount point to538writing 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
495and maximum size of the range (closed interval) to ``min`` and ``max`` files,542and maximum size of the range (closed interval) to ``min`` and ``max`` files,
496respectively. For ``target`` type, you can specify the index of the target543respectively. For ``target`` type, you can specify the index of the target
497between the list of the DAMON context's monitoring targets list to544between the list of the DAMON context's monitoring targets list to
498``target_idx`` file.545``damon_target_idx`` file.
499 546
500You can write ``Y`` or ``N`` to ``matching`` file to specify whether the filter547You can write ``Y`` or ``N`` to ``matching`` file to specify whether the filter
501is for memory that matches the ``type``. You can write ``Y`` or ``N`` to548is 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
603In each region directory, you will find five files (``start``, ``end``,650In each region directory, you will find five files (``start``, ``end``,
604``nr_accesses``, ``age``, and ``sz_filter_passed``). Reading the files will651``nr_accesses``, ``age`` and ``sz_filter_passed``). Reading the files will
605show the properties of the region that corresponding DAMON-based operation652show the properties of the region that corresponding DAMON-based operation
606scheme ``action`` has tried to be applied.653scheme ``action`` has tried to be applied.
607 654
655tried_regions/<N>/probes/
656-------------------------
657
658In each region directory, one directory (``probes``) also exists. In the
659directory, subdirectories named ``0`` to ``N-1`` exists. ``N`` is the number
660of installed probes. In each number-named directory, a file (``hits``) exist.
661Reading the file shows the number of data attributes monitoring probe-hit
662positive samples of the region.
663
608Example664Example
609~~~~~~~665~~~~~~~
610 666
@@ -677,7 +733,7 @@ show results using tracepoint supporting tools like ``perf``. For example:: · 66 unmodified lines
677 733
678Each line of the perf script output represents each monitoring region. The734Each line of the perf script output represents each monitoring region. The
679first five fields are as usual other tracepoint outputs. The sixth field735first 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. The736(``target_id=X``) shows the id of the monitoring target of the region. The
681seventh field (``nr_regions=X``) shows the total number of monitoring regions737seventh field (``nr_regions=X``) shows the total number of monitoring regions
682for the target. The eighth field (``X-Y:``) shows the start (``X``) and end738for 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 the739(``Y``) addresses of the region in bytes. The ninth field (``X``) shows the
Documentation/admin-guide/mm/transhuge.rst+2−2
@@ -57,7 +57,7 @@ prominent because the size of each page isn't as huge as the PMD-sized · 56 unmodified lines
57variant and there is less memory to clear in each page fault. Some57variant and there is less memory to clear in each page fault. Some
58architectures also employ TLB compression mechanisms to squeeze more58architectures also employ TLB compression mechanisms to squeeze more
59entries in when a set of PTEs are virtually and physically contiguous59entries in when a set of PTEs are virtually and physically contiguous
60and approporiately aligned. In this case, TLB misses will occur less60and appropriately aligned. In this case, TLB misses will occur less
61often.61often.
62 62
63THP can be enabled system wide or restricted to certain tasks or even63THP can be enabled system wide or restricted to certain tasks or even
@@ -210,7 +210,7 @@ PMD-mappable transparent hugepage:: · 146 unmodified lines
210 cat /sys/kernel/mm/transparent_hugepage/hpage_pmd_size210 cat /sys/kernel/mm/transparent_hugepage/hpage_pmd_size
211 211
212All THPs at fault and collapse time will be added to _deferred_list,212All THPs at fault and collapse time will be added to _deferred_list,
213and will therefore be split under memory presure if they are considered213and will therefore be split under memory pressure if they are considered
214"underused". A THP is underused if the number of zero-filled pages in214"underused". A THP is underused if the number of zero-filled pages in
215the THP is above max_ptes_none (see below). It is possible to disable215the THP is above max_ptes_none (see below). It is possible to disable
216this behaviour by writing 0 to shrink_underused, and enable it by writing216this behaviour by writing 0 to shrink_underused, and enable it by writing
Documentation/admin-guide/sysctl/vm.rst+2−0
@@ -1034,6 +1034,8 @@ min(3% of current process size, user_reserve_kbytes) of free memory. · 1033 unmodified lines
1034This is intended to prevent a user from starting a single memory hogging1034This is intended to prevent a user from starting a single memory hogging
1035process, such that they cannot recover (kill the hog).1035process, such that they cannot recover (kill the hog).
1036 1036
1037This setting has no effect when overcommit_memory is set to 0 or 1.
1038
1037user_reserve_kbytes defaults to min(3% of the current process size, 128MB).1039user_reserve_kbytes defaults to min(3% of the current process size, 128MB).
1038 1040
1039If this is reduced to zero, then the user will be allowed to allocate1041If this is reduced to zero, then the user will be allowed to allocate