Re: [PATCH v2 2/2] mm: convert do_set_pmd() to take a folio

From: Zi Yan
Date: Fri May 09 2025 - 11:01:44 EST


On 9 May 2025, at 9:01, Baolin Wang wrote:

> In do_set_pmd(), we always use the folio->page to build PMD mappings for
> the entire folio. Since all callers of do_set_pmd() already hold a stable
> folio, converting do_set_pmd() to take a folio is safe and more straightforward.
>
> In addition, to ensure the extensibility of do_set_pmd() for supporting
> larger folios beyond PMD size, we keep the 'page' parameter to specify
> which page within the folio should be mapped.
>
> No functional changes expected.
>
> Signed-off-by: Baolin Wang <baolin.wang@xxxxxxxxxxxxxxxxx>
> ---
> Changes from v1:
> - Keep the 'page' parameter of the do_set_pmd().
>
> Note: I did mm selftests and built kernel on tmpfs/xfs filesystems, and
> did not find any regression.
> ---
> include/linux/mm.h | 2 +-
> mm/filemap.c | 2 +-
> mm/khugepaged.c | 2 +-
> mm/memory.c | 11 +++++------
> 4 files changed, 8 insertions(+), 9 deletions(-)
>
LGTM. Reviewed-by: Zi Yan <ziy@xxxxxxxxxx>

--
Best Regards,
Yan, Zi