| Message ID | 20261104-b4-prep-vstor-149847-copy_huge_pmd-recheck-special-pmd-v5-1-c56d0d26f970@virtuozzo.com (mailing list archive) |
|---|---|
| State | Handled Elsewhere |
| Headers | show |
| Series | mm/huge_memory: copy PMDs at fork like the PTE path does | expand |
On 11/4/26 9:40 PM, Konstantin Khorenko wrote: > folio_dup_file_rmap_pmd() passes PGTABLE_LEVEL_PTE to > __folio_dup_file_rmap() for HPAGE_PMD_NR pages, so it adds HPAGE_PMD_NR > PTE mappings to the folio instead of one PMD mapping. > > The helper has no caller yet, the next patch adds the first one. Pass > PGTABLE_LEVEL_PMD, as folio_try_dup_anon_rmap_pmd() does. > > Fixes: d8ef5e311d7b ("mm/rmap: convert page_dup_file_rmap() to folio_dup_file_rmap_[pte|ptes|pmd]()") > Cc: stable@vger.kernel.org > Reviewed-by: Zi Yan <ziy@nvidia.com> > Reviewed-by: Kiryl Shutsemau (Meta) <kas@kernel.org> > Acked-by: David Hildenbrand (Arm) <david@kernel.org> > Signed-off-by: Konstantin Khorenko <khorenko@virtuozzo.com> LGTM: Reviewed-by: Jose A. Perez de Azpillaga <azpijr@gmail.com>
diff --git a/include/linux/rmap.h b/include/linux/rmap.h index 74cca0e3c7264..87c88a9811933 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h @@ -558,7 +558,7 @@ static inline void folio_dup_file_rmap_pmd(struct folio *folio, struct page *page, struct vm_area_struct *dst_vma) { #ifdef CONFIG_TRANSPARENT_HUGEPAGE - __folio_dup_file_rmap(folio, page, HPAGE_PMD_NR, dst_vma, PGTABLE_LEVEL_PTE); + __folio_dup_file_rmap(folio, page, HPAGE_PMD_NR, dst_vma, PGTABLE_LEVEL_PMD); #else WARN_ON_ONCE(true); #endif
folio_dup_file_rmap_pmd() passes PGTABLE_LEVEL_PTE to __folio_dup_file_rmap() for HPAGE_PMD_NR pages, so it adds HPAGE_PMD_NR PTE mappings to the folio instead of one PMD mapping. The helper has no caller yet, the next patch adds the first one. Pass PGTABLE_LEVEL_PMD, as folio_try_dup_anon_rmap_pmd() does. Fixes: d8ef5e311d7b ("mm/rmap: convert page_dup_file_rmap() to folio_dup_file_rmap_[pte|ptes|pmd]()") Cc: stable@vger.kernel.org Reviewed-by: Zi Yan <ziy@nvidia.com> Reviewed-by: Kiryl Shutsemau (Meta) <kas@kernel.org> Acked-by: David Hildenbrand (Arm) <david@kernel.org> Signed-off-by: Konstantin Khorenko <khorenko@virtuozzo.com> --- include/linux/rmap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)