Re: [PATCH v2] mm: make folio_pte_batch available outside of mm/memory.c

From: SeongJae Park
Date: Tue Feb 27 2024 - 16:54:36 EST


On Tue, 27 Feb 2024 23:42:01 +1300 Barry Song <21cnbao@xxxxxxxxx> wrote:

> From: Barry Song <v-songbaohua@xxxxxxxx>
>
> madvise, mprotect and some others might need folio_pte_batch to check if
> a range of PTEs are completely mapped to a large folio with contiguous
> physical addresses. Let's make it available in mm/internal.h.

Hi Barry,


I found this patch makes some of my build test that not setting CONFIG_MMU
fails with multiple errors including below:

In file included from .../mm/nommu.c:43:
.../mm/internal.h: In function '__pte_batch_clear_ignored':
.../mm/internal.h:98:23: error: implicit declaration of function 'pte_mkclean'; did you mean 'page_mkclean'? [-Werror=implicit-function-declaration]
98 | pte = pte_mkclean(pte);
| ^~~~~~~~~~~
| page_mkclean

Enabling CONFIG_MMU made the build success. I haven't had a time to look into
the code yet. May I ask your opinion?


Thanks,
SJ

[...]