The patch titled Subject: mm-hugetlb_vmemmap-remap-head-page-to-newly-allocated-page-v4 has been added to the -mm mm-unstable branch. Its filename is mm-hugetlb_vmemmap-remap-head-page-to-newly-allocated-page-v4.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-hugetlb_vmemmap-remap-head-page-to-newly-allocated-page-v4.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Joao Martins <joao.m.martins@xxxxxxxxxx> Subject: mm-hugetlb_vmemmap-remap-head-page-to-newly-allocated-page-v4 Date: Thu, 10 Nov 2022 12:12:14 +0000 add smp_wmb() to ensure page contents are visible prior to PTE write Link: https://lkml.kernel.org/r/20221110121214.6297-1-joao.m.martins@xxxxxxxxxx Signed-off-by: Joao Martins <joao.m.martins@xxxxxxxxxx> Reviewed-by: Muchun Song <songmuchun@xxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/hugetlb_vmemmap.c | 7 +++++++ 1 file changed, 7 insertions(+) --- a/mm/hugetlb_vmemmap.c~mm-hugetlb_vmemmap-remap-head-page-to-newly-allocated-page-v4 +++ a/mm/hugetlb_vmemmap.c @@ -246,6 +246,13 @@ static void vmemmap_remap_pte(pte_t *pte if (unlikely(addr == walk->reuse_addr)) { pgprot = PAGE_KERNEL; list_del(&walk->reuse_page->lru); + + /* + * Makes sure that preceding stores to the page contents from + * vmemmap_remap_free() become visible before the set_pte_at() + * write. + */ + smp_wmb(); } entry = mk_pte(walk->reuse_page, pgprot); _ Patches currently in -mm which might be from joao.m.martins@xxxxxxxxxx are mm-hugetlb_vmemmap-remap-head-page-to-newly-allocated-page.patch mm-hugetlb_vmemmap-remap-head-page-to-newly-allocated-page-v3.patch mm-hugetlb_vmemmap-remap-head-page-to-newly-allocated-page-v4.patch