]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mm-uffd-uffd_feature_wp_unpopulated-fix
authorPeter Xu <peterx@redhat.com>
Tue, 21 Mar 2023 20:09:26 +0000 (16:09 -0400)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 28 Mar 2023 23:25:01 +0000 (16:25 -0700)
Two comment changes suggested by David, and also a oneliner fix to
khugepaged (to bail out anon thp collapsing when seeing pte markers).

Link: https://lkml.kernel.org/r/ZB2/8jPhD3fpx5U8@x1n
Signed-off-by: Peter Xu <peterx@redhat.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Axel Rasmussen <axelrasmussen@google.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
Cc: Muhammad Usama Anjum <usama.anjum@collabora.com>
Cc: Nadav Amit <nadav.amit@gmail.com>
Cc: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Documentation/admin-guide/mm/userfaultfd.rst
mm/khugepaged.c
mm/mprotect.c

index c86b56c95ea67b515647399dd5efe5092bebd2a7..bd222629958312f0376c270dfd2a2052516a4eef 100644 (file)
@@ -226,7 +226,7 @@ For anonymous memory, ``ioctl(UFFDIO_WRITEPROTECT)`` will ignore none ptes
 (e.g. when pages are missing and not populated).  For file-backed memories
 like shmem and hugetlbfs, none ptes will be write protected just like a
 present pte.  In other words, there will be a userfaultfd write fault
-message generated when writting to a missing page on file typed memories,
+message generated when writing to a missing page on file typed memories,
 as long as the page range was write-protected before.  Such a message will
 not be generated on anonymous memories by default.
 
index 27956d44041347a75c2dc7820ba0a20ec85e20aa..bee7fd7db380a307a77fc0342e8101dc98584c56 100644 (file)
@@ -1178,7 +1178,7 @@ static int hpage_collapse_scan_pmd(struct mm_struct *mm,
                                 * enabled swap entries.  Please see
                                 * comment below for pte_uffd_wp().
                                 */
-                               if (pte_swp_uffd_wp(pteval)) {
+                               if (pte_swp_uffd_wp_any(pteval)) {
                                        result = SCAN_PTE_UFFD_WP;
                                        goto out_unmap;
                                }
index e27bbd0fde6f4bb858d760b59070bbe94b28f8d5..b9da9a5f87fe9290cc5f38ce1e45c27e4c750ef3 100644 (file)
@@ -329,8 +329,8 @@ static inline int pmd_none_or_clear_bad_unless_trans_huge(pmd_t *pmd)
 }
 
 /*
- * Return true if we want to split huge thps in change protection
- * procedure, false otherwise.
+ * Return true if we want to split THPs into PTE mappings in change
+ * protection procedure, false otherwise.
  */
 static inline bool
 pgtable_split_needed(struct vm_area_struct *vma, unsigned long cp_flags)