Skip to content

[Deepin-Kernel-SIG][linux-6.6-y][Upstream] docs/mm: add VMA locks documentation#1605

Merged
opsiff merged 1 commit intodeepin-community:linux-6.6.yfrom
opsiff:linux-6.6.y-2026-04-08-docs
Apr 8, 2026
Merged

[Deepin-Kernel-SIG][linux-6.6-y][Upstream] docs/mm: add VMA locks documentation#1605
opsiff merged 1 commit intodeepin-community:linux-6.6.yfrom
opsiff:linux-6.6.y-2026-04-08-docs

Conversation

@opsiff
Copy link
Copy Markdown
Member

@opsiff opsiff commented Apr 8, 2026

mainline inclusion
from mainline-v6.13-rc4
category: docs

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

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

(cherry picked from commit dbf8be8)

Summary by Sourcery

Documentation:

  • Add comprehensive documentation of mmap, VMA, and related page table locking semantics, including lock ordering and teardown edge cases, for both mm users and mm developers.

mainline inclusion
from mainline-v6.13-rc4
category: docs

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>
(cherry picked from commit dbf8be8)
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
@deepin-ci-robot deepin-ci-robot requested review from Wenlp and myml April 8, 2026 03:39
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai bot commented Apr 8, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Backports upstream documentation changes to extend Documentation/mm/process_addrs.rst with a detailed description of mmap/VMA locking rules, page table locking interactions, and guidance for both mm interface users and mm core developers.

File-Level Changes

Change Details Files
Extend the mm process address space documentation with a new section describing mmap/VMA locking and page table locking rules.
  • Add conceptual overview of how mm_struct and vm_area_struct are synchronized during mmap-related operations.
  • Document required locking primitives and ordering constraints for VMA operations, including page table teardown edge cases.
  • Highlight caveats and warnings for accessing page tables, emphasizing safe patterns for callers and kernel developers.
  • Separate guidance aimed at general mm interface users from deeper internal notes intended for mm subsystem developers.
Documentation/mm/process_addrs.rst

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 3 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="Documentation/mm/process_addrs.rst" line_range="170" />
<code_context>
+                         :c:macro:`!CONFIG_ARCH_HAS_PTE_SPECIAL`.
+   ===================== ======================================== ===========
+
+These fields describes the size, start and end of the VMA, and as such cannot be
+modified without first being hidden from the reverse mapping since these fields
+are used to locate VMAs within the reverse mapping interval trees.
</code_context>
<issue_to_address>
**issue (typo):** Use plural verb form with the plural subject "fields".

This should be "These fields describe the size, start and end of the VMA..." to match the plural subject.

```suggestion
These fields describe the size, start and end of the VMA, and as such cannot be
```
</issue_to_address>

### Comment 2
<location path="Documentation/mm/process_addrs.rst" line_range="471-474" />
<code_context>
+  and PUD each make use of the process address space granularity
+  :c:member:`!mm->page_table_lock` lock when modified.
+
+* **Fine-grained page table locks** - PMDs and PTEs each have fine-grained locks
+  either kept within the folios describing the page tables or allocated
+  separated and pointed at by the folios if :c:macro:`!ALLOC_SPLIT_PTLOCKS` is
+  set. The PMD spin lock is obtained via :c:func:`!pmd_lock`, however PTEs are
+  mapped into higher memory (if a 32-bit system) and carefully locked via
</code_context>
<issue_to_address>
**suggestion (typo):** Replace "allocated separated" with "allocated separately" for correct wording.

Here, "allocated separately and pointed at by the folios" (or "pointed to by the folios") would be more grammatical and clear.

```suggestion
* **Fine-grained page table locks** - PMDs and PTEs each have fine-grained locks
  either kept within the folios describing the page tables or allocated
  separately and pointed at by the folios if :c:macro:`!ALLOC_SPLIT_PTLOCKS` is
  set. The PMD spin lock is obtained via :c:func:`!pmd_lock`, however PTEs are
```
</issue_to_address>

### Comment 3
<location path="Documentation/mm/process_addrs.rst" line_range="568-570" />
<code_context>
+the page table entry only once.
+
+However, if we wish to manipulate an existing page table entry and care about
+the previously stored data, we must go further and use an hardware atomic
+operation as, for example, in :c:func:`!ptep_get_and_clear`.
+
</code_context>
<issue_to_address>
**issue (typo):** Change "an hardware" to "a hardware" for correct article usage.

Since "hardware" starts with a consonant sound, the article should be "a" rather than "an".

```suggestion
However, if we wish to manipulate an existing page table entry and care about
the previously stored data, we must go further and use a hardware atomic
operation as, for example, in :c:func:`!ptep_get_and_clear`.
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

:c:macro:`!CONFIG_ARCH_HAS_PTE_SPECIAL`.
===================== ======================================== ===========

These fields describes the size, start and end of the VMA, and as such cannot be
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (typo): Use plural verb form with the plural subject "fields".

This should be "These fields describe the size, start and end of the VMA..." to match the plural subject.

Suggested change
These fields describes the size, start and end of the VMA, and as such cannot be
These fields describe the size, start and end of the VMA, and as such cannot be

Comment on lines +471 to +474
* **Fine-grained page table locks** - PMDs and PTEs each have fine-grained locks
either kept within the folios describing the page tables or allocated
separated and pointed at by the folios if :c:macro:`!ALLOC_SPLIT_PTLOCKS` is
set. The PMD spin lock is obtained via :c:func:`!pmd_lock`, however PTEs are
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (typo): Replace "allocated separated" with "allocated separately" for correct wording.

Here, "allocated separately and pointed at by the folios" (or "pointed to by the folios") would be more grammatical and clear.

Suggested change
* **Fine-grained page table locks** - PMDs and PTEs each have fine-grained locks
either kept within the folios describing the page tables or allocated
separated and pointed at by the folios if :c:macro:`!ALLOC_SPLIT_PTLOCKS` is
set. The PMD spin lock is obtained via :c:func:`!pmd_lock`, however PTEs are
* **Fine-grained page table locks** - PMDs and PTEs each have fine-grained locks
either kept within the folios describing the page tables or allocated
separately and pointed at by the folios if :c:macro:`!ALLOC_SPLIT_PTLOCKS` is
set. The PMD spin lock is obtained via :c:func:`!pmd_lock`, however PTEs are

Comment on lines +568 to +570
However, if we wish to manipulate an existing page table entry and care about
the previously stored data, we must go further and use an hardware atomic
operation as, for example, in :c:func:`!ptep_get_and_clear`.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (typo): Change "an hardware" to "a hardware" for correct article usage.

Since "hardware" starts with a consonant sound, the article should be "a" rather than "an".

Suggested change
However, if we wish to manipulate an existing page table entry and care about
the previously stored data, we must go further and use an hardware atomic
operation as, for example, in :c:func:`!ptep_get_and_clear`.
However, if we wish to manipulate an existing page table entry and care about
the previously stored data, we must go further and use a hardware atomic
operation as, for example, in :c:func:`!ptep_get_and_clear`.

@Avenger-285714
Copy link
Copy Markdown
Member

/approve

@deepin-ci-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Avenger-285714

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR substantially expands Documentation/mm/process_addrs.rst to document VMA/mmap/rmap locking and closely related page table locking semantics, targeting both general mm interface users and mm developers.

Changes:

  • Adds a comprehensive overview of VMAs, mm_struct, and the different lock types (mmap/VMA/rmap) and their permitted combinations.
  • Documents page table operations (traversal/install/zap/free), locking requirements, ordering concerns, and PTE-level special cases.
  • Adds internal implementation notes on per-VMA locking and mmap write-lock downgrading behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +7 to +10
.. toctree::
:maxdepth: 3


Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The file adds a .. toctree:: directive but no entries, which typically triggers a Sphinx warning (empty toctree) and doesn’t provide navigation. Either remove this toctree block or add the intended child documents under it.

Suggested change
.. toctree::
:maxdepth: 3

Copilot uses AI. Check for mistakes.
Comment on lines +216 to +225
underlying object is reference counted
and can be shared across multiple VMAs
for scalability.
:c:member:`!swap_readahead_info` CONFIG_SWAP Metadata used by the swap mechanism mmap read,
to perform readahead. This field is swap-specific
accessed atomically. lock.
:c:member:`!vm_policy` CONFIG_NUMA :c:type:`!mempolicy` object which mmap write,
describes the NUMA behaviour of the VMA write.
VMA. The underlying object is reference
counted.
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This table row continuation uses tab characters for indentation. Tabs can break RST table alignment/rendering; replace tabs with spaces and align the wrapped description text with the other cells.

Suggested change
underlying object is reference counted
and can be shared across multiple VMAs
for scalability.
:c:member:`!swap_readahead_info` CONFIG_SWAP Metadata used by the swap mechanism mmap read,
to perform readahead. This field is swap-specific
accessed atomically. lock.
:c:member:`!vm_policy` CONFIG_NUMA :c:type:`!mempolicy` object which mmap write,
describes the NUMA behaviour of the VMA write.
VMA. The underlying object is reference
counted.
underlying object is reference counted
and can be shared across multiple VMAs
for scalability.
:c:member:`!swap_readahead_info` CONFIG_SWAP Metadata used by the swap mechanism mmap read,
to perform readahead. This field is swap-specific
accessed atomically. lock.
:c:member:`!vm_policy` CONFIG_NUMA :c:type:`!mempolicy` object which mmap write,
describes the NUMA behaviour of the VMA write.
VMA. The underlying object is reference
counted.

Copilot uses AI. Check for mistakes.
Comment on lines +216 to +225
underlying object is reference counted
and can be shared across multiple VMAs
for scalability.
:c:member:`!swap_readahead_info` CONFIG_SWAP Metadata used by the swap mechanism mmap read,
to perform readahead. This field is swap-specific
accessed atomically. lock.
:c:member:`!vm_policy` CONFIG_NUMA :c:type:`!mempolicy` object which mmap write,
describes the NUMA behaviour of the VMA write.
VMA. The underlying object is reference
counted.
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There’s a stray tab-indented continuation line inside the table ("counted."). Tabs can break RST table formatting; use spaces and align the wrapped text with the other cell contents.

Suggested change
underlying object is reference counted
and can be shared across multiple VMAs
for scalability.
:c:member:`!swap_readahead_info` CONFIG_SWAP Metadata used by the swap mechanism mmap read,
to perform readahead. This field is swap-specific
accessed atomically. lock.
:c:member:`!vm_policy` CONFIG_NUMA :c:type:`!mempolicy` object which mmap write,
describes the NUMA behaviour of the VMA write.
VMA. The underlying object is reference
counted.
underlying object is reference counted
and can be shared across multiple VMAs
for scalability.
:c:member:`!swap_readahead_info` CONFIG_SWAP Metadata used by the swap mechanism mmap read,
to perform readahead. This field is swap-specific
accessed atomically. lock.
:c:member:`!vm_policy` CONFIG_NUMA :c:type:`!mempolicy` object which mmap write,
describes the NUMA behaviour of the VMA write.
VMA. The underlying object is reference
counted.

Copilot uses AI. Check for mistakes.
Comment on lines +295 to +299
five the kernel cleverly 'folds' page table levels, that is stubbing
out functions related to the skipped levels. This allows us to
conceptually act as if there were always five levels, even if the
compiler might, in practice, eliminate any code relating to missing
ones.
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This .. note:: block uses tab indentation for its content. RST expects consistent space indentation; tabs can render incorrectly or fail doc builds. Replace the tabs with spaces and keep indentation consistent with other notes in the file.

Suggested change
five the kernel cleverly 'folds' page table levels, that is stubbing
out functions related to the skipped levels. This allows us to
conceptually act as if there were always five levels, even if the
compiler might, in practice, eliminate any code relating to missing
ones.
five the kernel cleverly 'folds' page table levels, that is stubbing
out functions related to the skipped levels. This allows us to
conceptually act as if there were always five levels, even if the
compiler might, in practice, eliminate any code relating to missing
ones.

Copilot uses AI. Check for mistakes.
Comment on lines +378 to +386
.. code-block::

inode->i_rwsem (while writing or truncating, not reading or faulting)
mm->mmap_lock
mapping->invalidate_lock (in filemap_fault)
folio_lock
hugetlbfs_i_mmap_rwsem_key (in huge_pmd_share, see hugetlbfs below)
vma_start_write
mapping->i_mmap_rwsem
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.. code-block:: normally requires an explicit language (e.g. text or none). As written, this may be rejected by Sphinx or rendered inconsistently. Specify an appropriate language for this lock-ordering snippet.

Copilot uses AI. Check for mistakes.

* **Fine-grained page table locks** - PMDs and PTEs each have fine-grained locks
either kept within the folios describing the page tables or allocated
separated and pointed at by the folios if :c:macro:`!ALLOC_SPLIT_PTLOCKS` is
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wording issue: “allocated separated” should be “allocated separately”.

Suggested change
separated and pointed at by the folios if :c:macro:`!ALLOC_SPLIT_PTLOCKS` is
separately and pointed at by the folios if :c:macro:`!ALLOC_SPLIT_PTLOCKS` is

Copilot uses AI. Check for mistakes.
Comment on lines +565 to +569
Each of these uses :c:func:`!READ_ONCE` to guarantee that the compiler reads
the page table entry only once.

However, if we wish to manipulate an existing page table entry and care about
the previously stored data, we must go further and use an hardware atomic
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

READ_ONCE is a macro, but it’s referenced as :c:func:!READ_ONCE here; consider using `:c:macro:`!READ_ONCE for correct markup. Also, “an hardware atomic operation” should be “a hardware atomic operation”.

Suggested change
Each of these uses :c:func:`!READ_ONCE` to guarantee that the compiler reads
the page table entry only once.
However, if we wish to manipulate an existing page table entry and care about
the previously stored data, we must go further and use an hardware atomic
Each of these uses :c:macro:`!READ_ONCE` to guarantee that the compiler reads
the page table entry only once.
However, if we wish to manipulate an existing page table entry and care about
the previously stored data, we must go further and use a hardware atomic

Copilot uses AI. Check for mistakes.
Terminology
-----------

* **mmap locks** - Each MM has a read/write semaphore :c:member:`!mmap_lock`
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence uses :c:member:!mmap_lock without indicating which type it belongs to. To avoid ambiguity, consider referencing it as `:c:member:`mm_struct.mmap_lock or otherwise making it explicit that this is mm_struct->mmap_lock.

Suggested change
* **mmap locks** - Each MM has a read/write semaphore :c:member:`!mmap_lock`
* **mmap locks** - Each MM has a read/write semaphore :c:member:`mm_struct.mmap_lock`

Copilot uses AI. Check for mistakes.
Comment on lines +380 to +386
inode->i_rwsem (while writing or truncating, not reading or faulting)
mm->mmap_lock
mapping->invalidate_lock (in filemap_fault)
folio_lock
hugetlbfs_i_mmap_rwsem_key (in huge_pmd_share, see hugetlbfs below)
vma_start_write
mapping->i_mmap_rwsem
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This lock-ordering snippet is introduced as the opening comment from mm/rmap.c, but it doesn’t match the actual comment in this branch (e.g., mm/rmap.c has page->flags PG_locked (lock_page) and additional locks, while this shows folio_lock). Consider quoting the current mm/rmap.c comment verbatim (or explicitly mark this as an adapted example).

Copilot uses AI. Check for mistakes.
Comment on lines +437 to +446
->page_table_lock or pte_lock
->swap_lock (try_to_unmap_one)
->private_lock (try_to_unmap_one)
->i_pages lock (try_to_unmap_one)
->lruvec->lru_lock (follow_page_mask->mark_page_accessed)
->lruvec->lru_lock (check_pte_range->folio_isolate_lru)
->private_lock (folio_remove_rmap_pte->set_page_dirty)
->i_pages lock (folio_remove_rmap_pte->set_page_dirty)
bdi.wb->list_lock (folio_remove_rmap_pte->set_page_dirty)
->inode->i_lock (folio_remove_rmap_pte->set_page_dirty)
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, this is presented as the lock-ordering comment from mm/filemap.c, but several entries differ from the actual comment in this branch (e.g. follow_page_mask vs follow_page, folio_remove_rmap_pte vs page_remove_rmap). To avoid confusion, consider syncing this snippet with the current mm/filemap.c comment or clearly labeling it as a non-verbatim/forward-looking version.

Copilot uses AI. Check for mistakes.
@Avenger-285714
Copy link
Copy Markdown
Member

It looks like there's no process_addrs.rst under Documentation/translations/zh_CN/mm (upstream). We could add it when getting chance.

@opsiff opsiff merged commit d74a7a4 into deepin-community:linux-6.6.y Apr 8, 2026
18 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants