Re: [PATCH 1/2] hugetlb: really allocate vma lock for all sharable vmas

From: Miaohe Lin
Date: Fri Dec 16 2022 - 20:59:57 EST


On 2022/12/13 7:50, Mike Kravetz wrote:
> Commit bbff39cc6cbc ("hugetlb: allocate vma lock for all sharable vmas")
> removed the pmd sharable checks in the vma lock helper routines.
> However, it left the functional version of helper routines behind #ifdef
> CONFIG_ARCH_WANT_HUGE_PMD_SHARE. Therefore, the vma lock is not being

Oh, we missed !CONFIG_ARCH_WANT_HUGE_PMD_SHARE case in the previous review. :(

> used for sharable vmas on architectures that do not support pmd sharing.
> On these architectures, a potential fault/truncation race is exposed
> that could leave pages in a hugetlb file past i_size until the file is
> removed.
>
> Move the functional vma lock helpers outside the ifdef, and remove the
> non-functional stubs. Since the vma lock is not just for pmd sharing,
> rename the routine __vma_shareable_flags_pmd.
>
> Fixes: bbff39cc6cbc ("hugetlb: allocate vma lock for all sharable vmas")
> Signed-off-by: Mike Kravetz <mike.kravetz@xxxxxxxxxx>

Thanks for fixing. This patch looks good to me. Thanks.

Reviewed-by: Miaohe Lin <linmiaohe@xxxxxxxxxx>

Thanks,
Miaohe Lin