Commit ea2ca359 authored by Barry Song's avatar Barry Song Committed by Kalesh Singh
Browse files

FROMGIT: BACKPORT: mm: introduce pmd|pte_needs_soft_dirty_wp helpers for softdirty write-protect

Patch series "mm: introduce pmd|pte_needs_soft_dirty_wp helpers and
utilize them", v2.

This patchset introduces the pte_need_soft_dirty_wp and
pmd_need_soft_dirty_wp helpers to determine if write protection is
required for softdirty tracking.  These helpers enhance code readability
and improve the overall appearance.

They are then utilized in gup, mprotect, swap, and other related
functions.

This patch (of 2):

This patch introduces the pte_needs_soft_dirty_wp and
pmd_needs_soft_dirty_wp helpers to determine if write protection is
required for softdirty tracking.  This can enhance code readability and
improve its overall appearance.  These new helpers are then utilized in
gup, huge_memory, and mprotect.

Link: https://lkml.kernel.org/r/20240607211358.4660-1-21cnbao@gmail.com
Link: https://lkml.kernel.org/r/20240607211358.4660-2-21cnbao@gmail.com


Change-Id: Ie7f7df016fbb44a97c99052b88438a3ad36b78a2
Signed-off-by: default avatarBarry Song <v-songbaohua@oppo.com>
Suggested-by: default avatarDavid Hildenbrand <david@redhat.com>
Acked-by: default avatarDavid Hildenbrand <david@redhat.com>
Cc: Chris Li <chrisl@kernel.org>
Cc: Kairui Song <kasong@tencent.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Bug: 313807618
[ Fix conflict in can_follow_write_pmd() which lives in mm/huge_memory.c
  in 6.6 but was later moved to mm/gup.c - Kalesh Singh ]
(cherry picked from commit 758a4f2de19e30e6e74e65175a1f38756edaf8af https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git

 mm-unstable)
Signed-off-by: default avatarKalesh Singh <kaleshsingh@google.com>
parent f7eeffbb
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment