mbox series

[v2,0/2] mm: introduce pmd|pte_needs_soft_dirty_wp helpers and utilize them

Message ID 20240607211358.4660-1-21cnbao@gmail.com (mailing list archive)
Headers show
Series mm: introduce pmd|pte_needs_soft_dirty_wp helpers and utilize them | expand

Message

Barry Song June 7, 2024, 9:13 p.m. UTC
From: Barry Song <v-songbaohua@oppo.com>

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.

-v2:
 * rename "need" to "needs" per David;
 * separate the change of do_swap_page() per david;

Thanks to David for his original suggestions on this[1].
[1] https://lore.kernel.org/linux-mm/baf84b51-7e8a-4da8-9662-3f5cf14ad6f6@redhat.com/

Barry Song (2):
  mm: introduce pmd|pte_needs_soft_dirty_wp helpers for softdirty
    write-protect
  mm: set pte writable while pmd_soft_dirty() is true in do_swap_page()

 mm/gup.c         |  4 ++--
 mm/huge_memory.c |  2 +-
 mm/internal.h    | 10 ++++++++++
 mm/memory.c      |  2 +-
 mm/mprotect.c    |  2 +-
 5 files changed, 15 insertions(+), 5 deletions(-)