Skip to content

Commit a8682d5

Browse files
David Hildenbrand (Red Hat)akpm00
authored andcommitted
mm/rmap: fix two comments related to huge_pmd_unshare()
PMD page table unsharing no longer touches the refcount of a PMD page table. Also, it is not about dropping the refcount of a "PMD page" but the "PMD page table". Let's just simplify by saying that the PMD page table was unmapped, consequently also unmapping the folio that was mapped into this page. This code should be deduplicated in the future. Link: https://lkml.kernel.org/r/20251223214037.580860-4-david@kernel.org Fixes: 59d9094 ("mm: hugetlb: independent PMD page table shared count") Signed-off-by: David Hildenbrand (Red Hat) <david@kernel.org> Reviewed-by: Rik van Riel <riel@surriel.com> Tested-by: Laurence Oberman <loberman@redhat.com> Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> Acked-by: Oscar Salvador <osalvador@suse.de> Cc: Liu Shixin <liushixin2@huawei.com> Cc: Harry Yoo <harry.yoo@oracle.com> Cc: Lance Yang <lance.yang@linux.dev> Cc: "Uschakow, Stanislav" <suschako@amazon.de> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent 3937027 commit a8682d5

1 file changed

Lines changed: 4 additions & 16 deletions

File tree

mm/rmap.c

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2016,14 +2016,8 @@ static bool try_to_unmap_one(struct folio *folio, struct vm_area_struct *vma,
20162016
flush_tlb_range(vma,
20172017
range.start, range.end);
20182018
/*
2019-
* The ref count of the PMD page was
2020-
* dropped which is part of the way map
2021-
* counting is done for shared PMDs.
2022-
* Return 'true' here. When there is
2023-
* no other sharing, huge_pmd_unshare
2024-
* returns false and we will unmap the
2025-
* actual page and drop map count
2026-
* to zero.
2019+
* The PMD table was unmapped,
2020+
* consequently unmapping the folio.
20272021
*/
20282022
goto walk_done;
20292023
}
@@ -2416,14 +2410,8 @@ static bool try_to_migrate_one(struct folio *folio, struct vm_area_struct *vma,
24162410
range.start, range.end);
24172411

24182412
/*
2419-
* The ref count of the PMD page was
2420-
* dropped which is part of the way map
2421-
* counting is done for shared PMDs.
2422-
* Return 'true' here. When there is
2423-
* no other sharing, huge_pmd_unshare
2424-
* returns false and we will unmap the
2425-
* actual page and drop map count
2426-
* to zero.
2413+
* The PMD table was unmapped,
2414+
* consequently unmapping the folio.
24272415
*/
24282416
page_vma_mapped_walk_done(&pvmw);
24292417
break;

0 commit comments

Comments
 (0)