Re: [PATCH mm-unstable v1] mm/hugetlb_vmemmap: don't synchronize_rcu() without HVO

From: Muchun Song
Date: Fri Jul 19 2024 - 02:19:36 EST




> On Jul 19, 2024, at 12:25, Yu Zhao <yuzhao@xxxxxxxxxx> wrote:
>
> hugetlb_vmemmap_optimize_folio() and hugetlb_vmemmap_restore_folio()
> are wrappers meant to be called regardless of whether HVO is enabled.
> Therefore, they should not call synchronize_rcu(). Otherwise, it
> regresses use cases not enabling HVO.
>
> So move synchronize_rcu() to __hugetlb_vmemmap_optimize_folio() and
> __hugetlb_vmemmap_restore_folio(), and call it once for each batch of
> folios when HVO is enabled.
>
> Fixes: bd225530a4c7 ("mm/hugetlb_vmemmap: fix race with speculative PFN walkers")
> Reported-by: kernel test robot <oliver.sang@xxxxxxxxx>
> Closes: https://lore.kernel.org/oe-lkp/202407091001.1250ad4a-oliver.sang@xxxxxxxxx
> Reported-by: Janosch Frank <frankja@xxxxxxxxxxxxx>
> Tested-by: Marc Hartmayer <mhartmay@xxxxxxxxxxxxx>
> Signed-off-by: Yu Zhao <yuzhao@xxxxxxxxxx>

Acked-by: Muchun Song <muchun.song@xxxxxxxxx>

Thanks.