From: sashiko-bot@kernel.org
To: "David Hildenbrand (Arm)" <david@kernel.org>
Cc: linux-s390@vger.kernel.org, "Heiko Carstens" <hca@linux.ibm.com>,
"Vasily Gorbik" <gor@linux.ibm.com>,
"Alexander Gordeev" <agordeev@linux.ibm.com>,
"Christian Borntraeger" <borntraeger@linux.ibm.com>
Subject: Re: [PATCH v2 06/15] mm/hugetlb: fix mremap() racing with page migration
Date: Mon, 16 Nov 2026 19:05:07 +0000 [thread overview]
Message-ID: <sashiko-outbox-217530@kernel.org> (raw)
In-Reply-To: <20261116-fixes_hugetlb-v2-6-4dd9e94ea9ac@kernel.org>
> Migration of anon hugetlb folios walks the anon_vma, so the file's
> i_mmap_rwsem does not serialize it against move_hugetlb_page_tables().
>
> There are various issues with that. Most importantly, move_huge_pte()
> releases both page table locks before the TLB is flushed. Migration can
> then find the destination entry and finish migration, reusing the old
> folio while the TLB still has entries cached.
>
> Hold the anon_vma write lock across the move and the final TLB flush.
> This also prevents concurrent rmap walks from missing entries moved
> during rollback.
>
> When we must allocate a destination page table, flush the TLB before
> dropping the anon_vma lock, then reacquire it after allocation.
>
> [ ... ]
> Fixes: 550a7d60bd5e ("mm, hugepages: add mremap() support for hugepage backed vma")
> Cc: stable@kernel.org
> Reported-by: Chris Mason <mason@kernel.org>
> Acked-by: Muchun Song <muchun.song@linux.dev>
> Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261116-fixes_hugetlb-v2-0-4dd9e94ea9ac@kernel.org?part=6
next prev parent reply other threads:[~2026-11-16 19:05 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 18:29 [PATCH v2 00/15] mm/hugetlb: various fixes David Hildenbrand (Arm)
2026-11-16 18:29 ` [PATCH v2 01/15] hugetlbfs: fix integer overflow in fallocate() David Hildenbrand (Arm)
2026-11-16 19:05 ` sashiko-bot
2026-11-16 18:29 ` [PATCH v2 02/15] mm/hugetlb: compare against persistent count when freeing lowmem folios David Hildenbrand (Arm)
2026-11-16 19:05 ` sashiko-bot
2026-11-16 22:24 ` Rik van Riel
2026-11-17 10:11 ` Oscar Salvador (SUSE)
2026-11-16 18:29 ` [PATCH v2 03/15] mm/hugetlb: preserve reservations when shrinking on HIGHMEM David Hildenbrand (Arm)
2026-11-16 19:05 ` sashiko-bot
2026-11-16 22:43 ` Rik van Riel
2026-11-17 10:13 ` Oscar Salvador (SUSE)
2026-11-16 18:29 ` [PATCH v2 04/15] mm/hugetlb: account temporary folios separately David Hildenbrand (Arm)
2026-11-16 19:05 ` sashiko-bot
2026-11-17 8:14 ` Gregory Price (Meta)
2026-11-17 10:16 ` Oscar Salvador (SUSE)
2026-11-16 18:29 ` [PATCH v2 05/15] mm/hugetlb: keep surplus folios when the pool shrinks David Hildenbrand (Arm)
2026-11-16 19:05 ` sashiko-bot
2026-11-16 18:29 ` [PATCH v2 06/15] mm/hugetlb: fix mremap() racing with page migration David Hildenbrand (Arm)
2026-11-16 19:05 ` sashiko-bot [this message]
2026-11-17 8:42 ` Gregory Price (Meta)
2026-11-16 18:29 ` [PATCH v2 07/15] hugetlbfs: fix unmapping folios from private VMAs David Hildenbrand (Arm)
2026-11-16 19:05 ` sashiko-bot
2026-11-17 8:31 ` Gregory Price (Meta)
2026-11-16 18:29 ` [PATCH v2 08/15] mm/hugetlb: serialize page-cache allocations with truncation David Hildenbrand (Arm)
2026-11-16 19:05 ` sashiko-bot
2026-11-16 18:29 ` [PATCH v2 09/15] mm/memfd: recheck the page cache before allocating a hugetlb folio David Hildenbrand (Arm)
2026-11-16 19:05 ` sashiko-bot
2026-11-17 8:34 ` Gregory Price (Meta)
2026-11-16 18:29 ` [PATCH v2 10/15] mm/hugetlb: count again if the reserve map shrank David Hildenbrand (Arm)
2026-11-16 19:05 ` sashiko-bot
2026-11-16 18:29 ` [PATCH v2 11/15] hugetlbfs: do not grow a sealed file in mmap() David Hildenbrand (Arm)
2026-11-16 19:05 ` sashiko-bot
2026-11-16 18:29 ` [PATCH v2 12/15] mm/hugetlb: keep surplus folios that are reserved David Hildenbrand (Arm)
2026-11-16 19:05 ` sashiko-bot
2026-11-16 18:29 ` [PATCH v2 13/15] mm/hugetlb: fix reservation leak on min_size= mounts David Hildenbrand (Arm)
2026-11-16 19:05 ` sashiko-bot
2026-11-16 18:29 ` [PATCH v2 14/15] mm/hugetlb: account restored reservations before freeing folios David Hildenbrand (Arm)
2026-11-16 19:05 ` sashiko-bot
2026-11-16 18:29 ` [PATCH v2 15/15] mm/hugetlb: delay anon folio rmap removal until after the TLB flush David Hildenbrand (Arm)
2026-11-16 19:05 ` sashiko-bot
2026-11-17 9:12 ` [PATCH v2 00/15] mm/hugetlb: various fixes David Hildenbrand (Arm)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=sashiko-outbox-217530@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=agordeev@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=david@kernel.org \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=linux-s390@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.