Re: [PATCH] mm/hugetlb: Move vmf_anon_prepare upfront in hugetlb_wp
From: Oscar Salvador
Date: Wed Jun 12 2024 - 16:27:21 EST
On Tue, May 21, 2024 at 09:34:46AM +0200, Oscar Salvador wrote:
> hugetlb_wp calls vmf_anon_prepare() after having allocated a page, which
> means that we might need to call restore_reserve_on_error() upon error.
> vmf_anon_prepare() releases the vma lock before returning, but
> restore_reserve_on_error() expects the vma lock to be held by the caller.
>
> Fix it by calling vmf_anon_prepare() before allocating the page.
>
> Signed-off-by: Oscar Salvador <osalvador@xxxxxxx>
> Fixes: 9acad7ba3e25 ("hugetlb: use vmf_anon_prepare() instead of anon_vma_prepare()")
Let me just revamp this and run away
--
Oscar Salvador
SUSE Labs