Skip to content

Commit 61307b7

Browse files
committed
Merge tag 'mm-stable-2024-05-17-19-19' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Pull mm updates from Andrew Morton: "The usual shower of singleton fixes and minor series all over MM, documented (hopefully adequately) in the respective changelogs. Notable series include: - Lucas Stach has provided some page-mapping cleanup/consolidation/ maintainability work in the series "mm/treewide: Remove pXd_huge() API". - In the series "Allow migrate on protnone reference with MPOL_PREFERRED_MANY policy", Donet Tom has optimized mempolicy's MPOL_PREFERRED_MANY mode, yielding almost doubled performance in one test. - In their series "Memory allocation profiling" Kent Overstreet and Suren Baghdasaryan have contributed a means of determining (via /proc/allocinfo) whereabouts in the kernel memory is being allocated: number of calls and amount of memory. - Matthew Wilcox has provided the series "Various significant MM patches" which does a number of rather unrelated things, but in largely similar code sites. - In his series "mm: page_alloc: freelist migratetype hygiene" Johannes Weiner has fixed the page allocator's handling of migratetype requests, with resulting improvements in compaction efficiency. - In the series "make the hugetlb migration strategy consistent" Baolin Wang has fixed a hugetlb migration issue, which should improve hugetlb allocation reliability. - Liu Shixin has hit an I/O meltdown caused by readahead in a memory-tight memcg. Addressed in the series "Fix I/O high when memory almost met memcg limit". - In the series "mm/filemap: optimize folio adding and splitting" Kairui Song has optimized pagecache insertion, yielding ~10% performance improvement in one test. - Baoquan He has cleaned up and consolidated the early zone initialization code in the series "mm/mm_init.c: refactor free_area_init_core()". - Baoquan has also redone some MM initializatio code in the series "mm/init: minor clean up and improvement". - MM helper cleanups from Christoph Hellwig in his series "remove follow_pfn". - More cleanups from Matthew Wilcox in the series "Various page->flags cleanups". - Vlastimil Babka has contributed maintainability improvements in the series "memcg_kmem hooks refactoring". - More folio conversions and cleanups in Matthew Wilcox's series: "Convert huge_zero_page to huge_zero_folio" "khugepaged folio conversions" "Remove page_idle and page_young wrappers" "Use folio APIs in procfs" "Clean up __folio_put()" "Some cleanups for memory-failure" "Remove page_mapping()" "More folio compat code removal" - David Hildenbrand chipped in with "fs/proc/task_mmu: convert hugetlb functions to work on folis". - Code consolidation and cleanup work related to GUP's handling of hugetlbs in Peter Xu's series "mm/gup: Unify hugetlb, part 2". - Rick Edgecombe has developed some fixes to stack guard gaps in the series "Cover a guard gap corner case". - Jinjiang Tu has fixed KSM's behaviour after a fork+exec in the series "mm/ksm: fix ksm exec support for prctl". - Baolin Wang has implemented NUMA balancing for multi-size THPs. This is a simple first-cut implementation for now. The series is "support multi-size THP numa balancing". - Cleanups to vma handling helper functions from Matthew Wilcox in the series "Unify vma_address and vma_pgoff_address". - Some selftests maintenance work from Dev Jain in the series "selftests/mm: mremap_test: Optimizations and style fixes". - Improvements to the swapping of multi-size THPs from Ryan Roberts in the series "Swap-out mTHP without splitting". - Kefeng Wang has significantly optimized the handling of arm64's permission page faults in the series "arch/mm/fault: accelerate pagefault when badaccess" "mm: remove arch's private VM_FAULT_BADMAP/BADACCESS" - GUP cleanups from David Hildenbrand in "mm/gup: consistently call it GUP-fast". - hugetlb fault code cleanups from Vishal Moola in "Hugetlb fault path to use struct vm_fault". - selftests build fixes from John Hubbard in the series "Fix selftests/mm build without requiring "make headers"". - Memory tiering fixes/improvements from Ho-Ren (Jack) Chuang in the series "Improved Memory Tier Creation for CPUless NUMA Nodes". Fixes the initialization code so that migration between different memory types works as intended. - David Hildenbrand has improved follow_pte() and fixed an errant driver in the series "mm: follow_pte() improvements and acrn follow_pte() fixes". - David also did some cleanup work on large folio mapcounts in his series "mm: mapcount for large folios + page_mapcount() cleanups". - Folio conversions in KSM in Alex Shi's series "transfer page to folio in KSM". - Barry Song has added some sysfs stats for monitoring multi-size THP's in the series "mm: add per-order mTHP alloc and swpout counters". - Some zswap cleanups from Yosry Ahmed in the series "zswap same-filled and limit checking cleanups". - Matthew Wilcox has been looking at buffer_head code and found the documentation to be lacking. The series is "Improve buffer head documentation". - Multi-size THPs get more work, this time from Lance Yang. His series "mm/madvise: enhance lazyfreeing with mTHP in madvise_free" optimizes the freeing of these things. - Kemeng Shi has added more userspace-visible writeback instrumentation in the series "Improve visibility of writeback". - Kemeng Shi then sent some maintenance work on top in the series "Fix and cleanups to page-writeback". - Matthew Wilcox reduces mmap_lock traffic in the anon vma code in the series "Improve anon_vma scalability for anon VMAs". Intel's test bot reported an improbable 3x improvement in one test. - SeongJae Park adds some DAMON feature work in the series "mm/damon: add a DAMOS filter type for page granularity access recheck" "selftests/damon: add DAMOS quota goal test" - Also some maintenance work in the series "mm/damon/paddr: simplify page level access re-check for pageout" "mm/damon: misc fixes and improvements" - David Hildenbrand has disabled some known-to-fail selftests ni the series "selftests: mm: cow: flag vmsplice() hugetlb tests as XFAIL". - memcg metadata storage optimizations from Shakeel Butt in "memcg: reduce memory consumption by memcg stats". - DAX fixes and maintenance work from Vishal Verma in the series "dax/bus.c: Fixups for dax-bus locking"" * tag 'mm-stable-2024-05-17-19-19' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (426 commits) memcg, oom: cleanup unused memcg_oom_gfp_mask and memcg_oom_order selftests/mm: hugetlb_madv_vs_map: avoid test skipping by querying hugepage size at runtime mm/hugetlb: add missing VM_FAULT_SET_HINDEX in hugetlb_wp mm/hugetlb: add missing VM_FAULT_SET_HINDEX in hugetlb_fault selftests: cgroup: add tests to verify the zswap writeback path mm: memcg: make alloc_mem_cgroup_per_node_info() return bool mm/damon/core: fix return value from damos_wmark_metric_value mm: do not update memcg stats for NR_{FILE/SHMEM}_PMDMAPPED selftests: cgroup: remove redundant enabling of memory controller Docs/mm/damon/maintainer-profile: allow posting patches based on damon/next tree Docs/mm/damon/maintainer-profile: change the maintainer's timezone from PST to PT Docs/mm/damon/design: use a list for supported filters Docs/admin-guide/mm/damon/usage: fix wrong schemes effective quota update command Docs/admin-guide/mm/damon/usage: fix wrong example of DAMOS filter matching sysfs file selftests/damon: classify tests for functionalities and regressions selftests/damon/_damon_sysfs: use 'is' instead of '==' for 'None' selftests/damon/_damon_sysfs: find sysfs mount point from /proc/mounts selftests/damon/_damon_sysfs: check errors from nr_schemes file reads mm/damon/core: initialize ->esz_bp from damos_quota_init_priv() selftests/damon: add a test for DAMOS quota goal ...
2 parents 0450d20 + 76edc53 commit 61307b7

File tree

387 files changed

+9700
-5732
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

387 files changed

+9700
-5732
lines changed

Documentation/ABI/testing/sysfs-kernel-mm-damon

+3-3
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,9 @@ Date: Dec 2022
314314
Contact: SeongJae Park <sj@kernel.org>
315315
Description: Writing to and reading from this file sets and gets the type of
316316
the memory of the interest. 'anon' for anonymous pages,
317-
'memcg' for specific memory cgroup, 'addr' for address range
318-
(an open-ended interval), or 'target' for DAMON monitoring
319-
target can be written and read.
317+
'memcg' for specific memory cgroup, 'young' for young pages,
318+
'addr' for address range (an open-ended interval), or 'target'
319+
for DAMON monitoring target can be written and read.
320320

321321
What: /sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/filters/<F>/memcg_path
322322
Date: Dec 2022
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
What: /sys/kernel/mm/transparent_hugepage/
2+
Date: April 2024
3+
Contact: Linux memory management mailing list <linux-mm@kvack.org>
4+
Description:
5+
/sys/kernel/mm/transparent_hugepage/ contains a number of files and
6+
subdirectories,
7+
8+
- defrag
9+
- enabled
10+
- hpage_pmd_size
11+
- khugepaged
12+
- shmem_enabled
13+
- use_zero_page
14+
- subdirectories of the form hugepages-<size>kB, where <size>
15+
is the page size of the hugepages supported by the kernel/CPU
16+
combination.
17+
18+
See Documentation/admin-guide/mm/transhuge.rst for details.

Documentation/admin-guide/blockdev/zram.rst

+5
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,11 @@ of equal or greater size:::
466466
#recompress idle pages larger than 2000 bytes
467467
echo "type=idle threshold=2000" > /sys/block/zramX/recompress
468468

469+
It is also possible to limit the number of pages zram re-compression will
470+
attempt to recompress:::
471+
472+
echo "type=huge_idle max_pages=42" > /sys/block/zramX/recompress
473+
469474
Recompression of idle pages requires memory tracking.
470475

471476
During re-compression for every page, that matches re-compression criteria,

Documentation/admin-guide/cgroup-v1/memory.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -300,14 +300,14 @@ When oom event notifier is registered, event will be delivered.
300300

301301
Lock order is as follows::
302302

303-
Page lock (PG_locked bit of page->flags)
303+
folio_lock
304304
mm->page_table_lock or split pte_lock
305305
folio_memcg_lock (memcg->move_lock)
306306
mapping->i_pages lock
307307
lruvec->lru_lock.
308308

309309
Per-node-per-memcgroup LRU (cgroup's private LRU) is guarded by
310-
lruvec->lru_lock; PG_lru bit of page->flags is cleared before
310+
lruvec->lru_lock; the folio LRU flag is cleared before
311311
isolating a page from its LRU under lruvec->lru_lock.
312312

313313
.. _cgroup-v1-memory-kernel-extension:
@@ -802,8 +802,8 @@ a page or a swap can be moved only when it is charged to the task's current
802802
| | anonymous pages, file pages (and swaps) in the range mmapped by the task |
803803
| | will be moved even if the task hasn't done page fault, i.e. they might |
804804
| | not be the task's "RSS", but other task's "RSS" that maps the same file. |
805-
| | And mapcount of the page is ignored (the page can be moved even if |
806-
| | page_mapcount(page) > 1). You must enable Swap Extension (see 2.4) to |
805+
| | The mapcount of the page is ignored (the page can be moved independent |
806+
| | of the mapcount). You must enable Swap Extension (see 2.4) to |
807807
| | enable move of swap charges. |
808808
+---+--------------------------------------------------------------------------+
809809

Documentation/admin-guide/kernel-parameters.txt

+6
Original file line numberDiff line numberDiff line change
@@ -2151,6 +2151,12 @@
21512151
Format: 0 | 1
21522152
Default set by CONFIG_INIT_ON_FREE_DEFAULT_ON.
21532153

2154+
init_mlocked_on_free= [MM] Fill freed userspace memory with zeroes if
2155+
it was mlock'ed and not explicitly munlock'ed
2156+
afterwards.
2157+
Format: 0 | 1
2158+
Default set by CONFIG_INIT_MLOCKED_ON_FREE_DEFAULT_ON
2159+
21542160
init_pkru= [X86] Specify the default memory protection keys rights
21552161
register contents for all processes. 0x55555554 by
21562162
default (disallow access to all but pkey 0). Can

Documentation/admin-guide/mm/damon/usage.rst

+16-16
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ Users can write below commands for the kdamond to the ``state`` file.
153153
- ``clear_schemes_tried_regions``: Clear the DAMON-based operating scheme
154154
action tried regions directory for each DAMON-based operation scheme of the
155155
kdamond.
156-
- ``update_schemes_effective_bytes``: Update the contents of
156+
- ``update_schemes_effective_quotas``: Update the contents of
157157
``effective_bytes`` files for each DAMON-based operation scheme of the
158158
kdamond. For more details, refer to :ref:`quotas directory <sysfs_quotas>`.
159159

@@ -342,7 +342,7 @@ Based on the user-specified :ref:`goal <sysfs_schemes_quota_goals>`, the
342342
effective size quota is further adjusted. Reading ``effective_bytes`` returns
343343
the current effective size quota. The file is not updated in real time, so
344344
users should ask DAMON sysfs interface to update the content of the file for
345-
the stats by writing a special keyword, ``update_schemes_effective_bytes`` to
345+
the stats by writing a special keyword, ``update_schemes_effective_quotas`` to
346346
the relevant ``kdamonds/<N>/state`` file.
347347

348348
Under ``weights`` directory, three files (``sz_permil``,
@@ -410,19 +410,19 @@ in the numeric order.
410410

411411
Each filter directory contains six files, namely ``type``, ``matcing``,
412412
``memcg_path``, ``addr_start``, ``addr_end``, and ``target_idx``. To ``type``
413-
file, you can write one of four special keywords: ``anon`` for anonymous pages,
414-
``memcg`` for specific memory cgroup, ``addr`` for specific address range (an
415-
open-ended interval), or ``target`` for specific DAMON monitoring target
416-
filtering. In case of the memory cgroup filtering, you can specify the memory
417-
cgroup of the interest by writing the path of the memory cgroup from the
418-
cgroups mount point to ``memcg_path`` file. In case of the address range
419-
filtering, you can specify the start and end address of the range to
420-
``addr_start`` and ``addr_end`` files, respectively. For the DAMON monitoring
421-
target filtering, you can specify the index of the target between the list of
422-
the DAMON context's monitoring targets list to ``target_idx`` file. You can
423-
write ``Y`` or ``N`` to ``matching`` file to filter out pages that does or does
424-
not match to the type, respectively. Then, the scheme's action will not be
425-
applied to the pages that specified to be filtered out.
413+
file, you can write one of five special keywords: ``anon`` for anonymous pages,
414+
``memcg`` for specific memory cgroup, ``young`` for young pages, ``addr`` for
415+
specific address range (an open-ended interval), or ``target`` for specific
416+
DAMON monitoring target filtering. In case of the memory cgroup filtering, you
417+
can specify the memory cgroup of the interest by writing the path of the memory
418+
cgroup from the cgroups mount point to ``memcg_path`` file. In case of the
419+
address range filtering, you can specify the start and end address of the range
420+
to ``addr_start`` and ``addr_end`` files, respectively. For the DAMON
421+
monitoring target filtering, you can specify the index of the target between
422+
the list of the DAMON context's monitoring targets list to ``target_idx`` file.
423+
You can write ``Y`` or ``N`` to ``matching`` file to filter out pages that does
424+
or does not match to the type, respectively. Then, the scheme's action will
425+
not be applied to the pages that specified to be filtered out.
426426

427427
For example, below restricts a DAMOS action to be applied to only non-anonymous
428428
pages of all memory cgroups except ``/having_care_already``.::
@@ -434,7 +434,7 @@ pages of all memory cgroups except ``/having_care_already``.::
434434
# # further filter out all cgroups except one at '/having_care_already'
435435
echo memcg > 1/type
436436
echo /having_care_already > 1/memcg_path
437-
echo N > 1/matching
437+
echo Y > 1/matching
438438

439439
Note that ``anon`` and ``memcg`` filters are currently supported only when
440440
``paddr`` :ref:`implementation <sysfs_context>` is being used.

Documentation/admin-guide/mm/hugetlbpage.rst

+7
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,13 @@ Note that the number of overcommit and reserve pages remain global quantities,
376376
as we don't know until fault time, when the faulting task's mempolicy is
377377
applied, from which node the huge page allocation will be attempted.
378378

379+
The hugetlb may be migrated between the per-node hugepages pool in the following
380+
scenarios: memory offline, memory failure, longterm pinning, syscalls(mbind,
381+
migrate_pages and move_pages), alloc_contig_range() and alloc_contig_pages().
382+
Now only memory offline, memory failure and syscalls allow fallbacking to allocate
383+
a new hugetlb on a different node if the current node is unable to allocate during
384+
hugetlb migration, that means these 3 cases can break the per-node hugepages pool.
385+
379386
.. _using_huge_pages:
380387

381388
Using Huge Pages

Documentation/admin-guide/mm/transhuge.rst

+32-3
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,8 @@ collapsed, resulting fewer pages being collapsed into
278278
THPs, and lower memory access performance.
279279

280280
``max_ptes_shared`` specifies how many pages can be shared across multiple
281-
processes. Exceeding the number would block the collapse::
281+
processes. khugepaged might treat pages of THPs as shared if any page of
282+
that THP is shared. Exceeding the number would block the collapse::
282283

283284
/sys/kernel/mm/transparent_hugepage/khugepaged/max_ptes_shared
284285

@@ -369,15 +370,15 @@ monitor how successfully the system is providing huge pages for use.
369370

370371
thp_fault_alloc
371372
is incremented every time a huge page is successfully
372-
allocated to handle a page fault.
373+
allocated and charged to handle a page fault.
373374

374375
thp_collapse_alloc
375376
is incremented by khugepaged when it has found
376377
a range of pages to collapse into one huge page and has
377378
successfully allocated a new huge page to store the data.
378379

379380
thp_fault_fallback
380-
is incremented if a page fault fails to allocate
381+
is incremented if a page fault fails to allocate or charge
381382
a huge page and instead falls back to using small pages.
382383

383384
thp_fault_fallback_charge
@@ -447,6 +448,34 @@ thp_swpout_fallback
447448
Usually because failed to allocate some continuous swap space
448449
for the huge page.
449450

451+
In /sys/kernel/mm/transparent_hugepage/hugepages-<size>kB/stats, There are
452+
also individual counters for each huge page size, which can be utilized to
453+
monitor the system's effectiveness in providing huge pages for usage. Each
454+
counter has its own corresponding file.
455+
456+
anon_fault_alloc
457+
is incremented every time a huge page is successfully
458+
allocated and charged to handle a page fault.
459+
460+
anon_fault_fallback
461+
is incremented if a page fault fails to allocate or charge
462+
a huge page and instead falls back to using huge pages with
463+
lower orders or small pages.
464+
465+
anon_fault_fallback_charge
466+
is incremented if a page fault fails to charge a huge page and
467+
instead falls back to using huge pages with lower orders or
468+
small pages even though the allocation was successful.
469+
470+
anon_swpout
471+
is incremented every time a huge page is swapped out in one
472+
piece without splitting.
473+
474+
anon_swpout_fallback
475+
is incremented if a huge page has to be split before swapout.
476+
Usually because failed to allocate some continuous swap space
477+
for the huge page.
478+
450479
As the system ages, allocating huge pages may be expensive as the
451480
system uses memory compaction to copy data around memory to free a
452481
huge page for use. There are some counters in ``/proc/vmstat`` to help

Documentation/admin-guide/mm/zswap.rst

-29
Original file line numberDiff line numberDiff line change
@@ -111,35 +111,6 @@ checked if it is a same-value filled page before compressing it. If true, the
111111
compressed length of the page is set to zero and the pattern or same-filled
112112
value is stored.
113113

114-
Same-value filled pages identification feature is enabled by default and can be
115-
disabled at boot time by setting the ``same_filled_pages_enabled`` attribute
116-
to 0, e.g. ``zswap.same_filled_pages_enabled=0``. It can also be enabled and
117-
disabled at runtime using the sysfs ``same_filled_pages_enabled``
118-
attribute, e.g.::
119-
120-
echo 1 > /sys/module/zswap/parameters/same_filled_pages_enabled
121-
122-
When zswap same-filled page identification is disabled at runtime, it will stop
123-
checking for the same-value filled pages during store operation.
124-
In other words, every page will be then considered non-same-value filled.
125-
However, the existing pages which are marked as same-value filled pages remain
126-
stored unchanged in zswap until they are either loaded or invalidated.
127-
128-
In some circumstances it might be advantageous to make use of just the zswap
129-
ability to efficiently store same-filled pages without enabling the whole
130-
compressed page storage.
131-
In this case the handling of non-same-value pages by zswap (enabled by default)
132-
can be disabled by setting the ``non_same_filled_pages_enabled`` attribute
133-
to 0, e.g. ``zswap.non_same_filled_pages_enabled=0``.
134-
It can also be enabled and disabled at runtime using the sysfs
135-
``non_same_filled_pages_enabled`` attribute, e.g.::
136-
137-
echo 1 > /sys/module/zswap/parameters/non_same_filled_pages_enabled
138-
139-
Disabling both ``zswap.same_filled_pages_enabled`` and
140-
``zswap.non_same_filled_pages_enabled`` effectively disables accepting any new
141-
pages by zswap.
142-
143114
To prevent zswap from shrinking pool when zswap is full and there's a high
144115
pressure on swap (this will result in flipping pages in and out zswap pool
145116
without any real benefit but with a performance drop for the system), a

Documentation/admin-guide/sysctl/vm.rst

+16
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ Currently, these files are in /proc/sys/vm:
4343
- legacy_va_layout
4444
- lowmem_reserve_ratio
4545
- max_map_count
46+
- mem_profiling (only if CONFIG_MEM_ALLOC_PROFILING=y)
4647
- memory_failure_early_kill
4748
- memory_failure_recovery
4849
- min_free_kbytes
@@ -425,6 +426,21 @@ e.g., up to one or two maps per allocation.
425426
The default value is 65530.
426427

427428

429+
mem_profiling
430+
==============
431+
432+
Enable memory profiling (when CONFIG_MEM_ALLOC_PROFILING=y)
433+
434+
1: Enable memory profiling.
435+
436+
0: Disable memory profiling.
437+
438+
Enabling memory profiling introduces a small performance overhead for all
439+
memory allocations.
440+
441+
The default value depends on CONFIG_MEM_ALLOC_PROFILING_ENABLED_BY_DEFAULT.
442+
443+
428444
memory_failure_early_kill:
429445
==========================
430446

Documentation/driver-api/crypto/iaa/iaa-crypto.rst

-2
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,6 @@ Use the following commands to enable zswap::
471471
# echo deflate-iaa > /sys/module/zswap/parameters/compressor
472472
# echo zsmalloc > /sys/module/zswap/parameters/zpool
473473
# echo 1 > /sys/module/zswap/parameters/enabled
474-
# echo 0 > /sys/module/zswap/parameters/same_filled_pages_enabled
475474
# echo 100 > /proc/sys/vm/swappiness
476475
# echo never > /sys/kernel/mm/transparent_hugepage/enabled
477476
# echo 1 > /proc/sys/vm/overcommit_memory
@@ -621,7 +620,6 @@ the 'fixed' compression mode::
621620
echo deflate-iaa > /sys/module/zswap/parameters/compressor
622621
echo zsmalloc > /sys/module/zswap/parameters/zpool
623622
echo 1 > /sys/module/zswap/parameters/enabled
624-
echo 0 > /sys/module/zswap/parameters/same_filled_pages_enabled
625623

626624
echo 100 > /proc/sys/vm/swappiness
627625
echo never > /sys/kernel/mm/transparent_hugepage/enabled

Documentation/filesystems/api-summary.rst

-3
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,6 @@ Other Functions
5656
.. kernel-doc:: fs/namei.c
5757
:export:
5858

59-
.. kernel-doc:: fs/buffer.c
60-
:export:
61-
6259
.. kernel-doc:: block/bio.c
6360
:export:
6461

Documentation/filesystems/buffer.rst

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Buffer Heads
2+
============
3+
4+
Linux uses buffer heads to maintain state about individual filesystem blocks.
5+
Buffer heads are deprecated and new filesystems should use iomap instead.
6+
7+
Functions
8+
---------
9+
10+
.. kernel-doc:: include/linux/buffer_head.h
11+
.. kernel-doc:: fs/buffer.c
12+
:export:

Documentation/filesystems/index.rst

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ filesystem implementations.
5050
.. toctree::
5151
:maxdepth: 2
5252

53+
buffer
5354
journalling
5455
fscrypt
5556
fsverity

Documentation/filesystems/proc.rst

+29
Original file line numberDiff line numberDiff line change
@@ -688,6 +688,7 @@ files are there, and which are missing.
688688
============ ===============================================================
689689
File Content
690690
============ ===============================================================
691+
allocinfo Memory allocations profiling information
691692
apm Advanced power management info
692693
bootconfig Kernel command line obtained from boot config,
693694
and, if there were kernel parameters from the
@@ -953,6 +954,34 @@ also be allocatable although a lot of filesystem metadata may have to be
953954
reclaimed to achieve this.
954955

955956

957+
allocinfo
958+
~~~~~~~~~
959+
960+
Provides information about memory allocations at all locations in the code
961+
base. Each allocation in the code is identified by its source file, line
962+
number, module (if originates from a loadable module) and the function calling
963+
the allocation. The number of bytes allocated and number of calls at each
964+
location are reported.
965+
966+
Example output.
967+
968+
::
969+
970+
> sort -rn /proc/allocinfo
971+
127664128 31168 mm/page_ext.c:270 func:alloc_page_ext
972+
56373248 4737 mm/slub.c:2259 func:alloc_slab_page
973+
14880768 3633 mm/readahead.c:247 func:page_cache_ra_unbounded
974+
14417920 3520 mm/mm_init.c:2530 func:alloc_large_system_hash
975+
13377536 234 block/blk-mq.c:3421 func:blk_mq_alloc_rqs
976+
11718656 2861 mm/filemap.c:1919 func:__filemap_get_folio
977+
9192960 2800 kernel/fork.c:307 func:alloc_thread_stack_node
978+
4206592 4 net/netfilter/nf_conntrack_core.c:2567 func:nf_ct_alloc_hashtable
979+
4136960 1010 drivers/staging/ctagmod/ctagmod.c:20 [ctagmod] func:ctagmod_start
980+
3940352 962 mm/memory.c:4214 func:alloc_anon_folio
981+
2894464 22613 fs/kernfs/dir.c:615 func:__kernfs_new_node
982+
...
983+
984+
956985
meminfo
957986
~~~~~~~
958987

0 commit comments

Comments
 (0)