Re: [PATCH v3] mm: use nth_page instead of mem_map_offset mem_map_next

From: Matthew Wilcox
Date: Fri Sep 09 2022 - 13:47:06 EST


On Fri, Sep 09, 2022 at 07:31:09AM +0000, Cheng Li wrote:
> To handle discontiguity case, mem_map_next() has a parameter named
> `offset`. As a function caller, one would be confused why "get
> next entry" needs a parameter named "offset". The other drawback of
> mem_map_next() is that the callers must take care of the map between
> parameter "iter" and "offset", otherwise we may get an hole or
> duplication during iteration. So we use nth_page instead of
> mem_map_next.
>
> And replace mem_map_offset with nth_page() per Matthew's comments.
>
> Signed-off-by: Cheng Li <lic121@xxxxxxxxxxxxxxx>
> Fixes: 69d177c2fc70 ("hugetlbfs: handle pages higher order than MAX_ORDER")

Reviewed-by: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx>