Re: [PATCH 0/3] mm/uffd: Fix missing markers on hugetlb

From: David Hildenbrand
Date: Thu Jan 05 2023 - 03:20:00 EST


On 04.01.23 23:52, Peter Xu wrote:
When James was developing the vma split fix for hugetlb pmd sharing, he
found that hugetlb uffd-wp is broken with the test case he developed [1]:

https://lore.kernel.org/r/CADrL8HWSym93=yNpTUdWebOEzUOTR2ffbfUk04XdK6O+PNJNoA@xxxxxxxxxxxxxx

Missing hugetlb pgtable pages caused uffd-wp to lose message when vma split
happens to be across a shared huge pmd range in the test.

The issue is pgtable pre-allocation on hugetlb path was overlooked. That
was fixed in patch 1.

Nice timing, I stumbled over that while adjusting background snapshot code in QEMU and wondered why we are not allocating page tables in that case -- and wanted to ask you why :)

--
Thanks,

David / dhildenb