linux/Documentation/mm
Lorenzo Stoakes dbf8be8218 docs/mm: add VMA locks documentation
Locking around VMAs is complicated and confusing.  While we have a number
of disparate comments scattered around the place, we seem to be reaching a
level of complexity that justifies a serious effort at clearly documenting
how locks are expected to be used when it comes to interacting with
mm_struct and vm_area_struct objects.

This is especially pertinent as regards the efforts to find sensible
abstractions for these fundamental objects in kernel rust code whose
compiler strictly requires some means of expressing these rules (and
through this expression, self-document these requirements as well as
enforce them).

The document limits scope to mmap and VMA locks and those that are
immediately adjacent and relevant to them - so additionally covers page
table locking as this is so very closely tied to VMA operations (and
relies upon us handling these correctly).

The document tries to cover some of the nastier and more confusing edge
cases and concerns especially around lock ordering and page table
teardown.

The document is split between generally useful information for users of mm
interfaces, and separately a section intended for mm kernel developers
providing a discussion around internal implementation details.

[lorenzo.stoakes@oracle.com: v3]
  Link: https://lkml.kernel.org/r/20241114205402.859737-1-lorenzo.stoakes@oracle.com
[lorenzo.stoakes@oracle.com: docs/mm: minor corrections]
  Link: https://lkml.kernel.org/r/d3de735a-25ae-4eb2-866c-a9624fe6f795@lucifer.local
[jannh@google.com: docs/mm: add more warnings around page table access]
  Link: https://lkml.kernel.org/r/20241118-vma-docs-addition1-onv3-v2-1-c9d5395b72ee@google.com
Link: https://lkml.kernel.org/r/20241108135708.48567-1-lorenzo.stoakes@oracle.com
Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Acked-by: Qi Zheng <zhengqi.arch@bytedance.com>
Acked-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Reviewed-by: Bagas Sanjaya <bagasdotme@gmail.com>
Reviewed-by: Jann Horn <jannh@google.com>
Cc: Alice Ryhl <aliceryhl@google.com>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Hillf Danton <hdanton@sina.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Liam R. Howlett <Liam.Howlett@Oracle.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: SeongJae Park <sj@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2024-12-18 19:04:41 -08:00
..
damon Docs/mm/damon: recommend academic papers to read and/or cite 2024-11-11 17:22:27 -08:00
active_mm.rst
allocation-profiling.rst alloc_tag: support for page allocation tag compression 2024-11-07 14:25:16 -08:00
arch_pgtable_helpers.rst mm: drop leftover comment references to pxx_huge() 2024-07-03 19:30:02 -07:00
balance.rst
bootmem.rst
free_page_reporting.rst
highmem.rst
hmm.rst docs:mm: fix spelling mistakes in heterogeneous memory management page 2024-09-10 15:14:57 -06:00
hugetlbfs_reserv.rst
hwpoison.rst
index.rst Docs/mm/index: move allocation profiling document to unsorted documents chapter 2024-07-03 16:19:15 -06:00
ksm.rst
memory-model.rst
mmu_notifier.rst
multigen_lru.rst
numa.rst
oom.rst
overcommit-accounting.rst docs: mm: fix vm overcommit documentation for OVERCOMMIT_GUESS 2023-10-10 13:35:55 -06:00
page_allocation.rst
page_cache.rst ubifs: Convert ubifs_vm_page_mkwrite() to use a folio 2024-02-25 21:08:00 +01:00
page_frags.rst net: remove gfp_mask from napi_alloc_skb() 2024-03-28 18:30:40 -07:00
page_migration.rst mm: remove isolate_lru_page() 2024-09-09 16:38:59 -07:00
page_owner.rst mm,page_owner: fix refcount imbalance 2024-04-16 15:39:49 -07:00
page_reclaim.rst
page_table_check.rst mm/page_table_check: support userfault wr-protect entries 2024-05-05 17:53:41 -07:00
page_tables.rst Docs/mm: Fix a mistake for pfn in page_tables.rst 2024-10-14 10:16:16 -06:00
physical_memory.rst
process_addrs.rst docs/mm: add VMA locks documentation 2024-12-18 19:04:41 -08:00
remap_file_pages.rst
shmfs.rst
slab.rst
slub.rst SLUB: Add support for per object memory policies 2024-10-29 10:43:53 +01:00
split_page_table_lock.rst mm: pgtable: remove pte_offset_map_nolock() 2024-11-05 16:56:29 -08:00
swap.rst
transhuge.rst mm: remove follow_page() 2024-09-01 20:26:01 -07:00
unevictable-lru.rst mm: remove isolate_lru_page() 2024-09-09 16:38:59 -07:00
vmalloc.rst
vmalloced-kernel-stacks.rst docs:mm: fixed spelling and grammar mistakes on vmalloc kernel stack page 2024-09-10 15:31:45 -06:00
vmemmap_dedup.rst remove references to page->flags in documentation 2024-04-25 20:56:15 -07:00
z3fold.rst
zsmalloc.rst