Re: [RFC PATCH v2 1/3] mm/huge_memory: make persistent huge zero folio read-only

From: Xueyuan Chen

Date: Thu Jun 18 2026 - 22:56:11 EST


On Thu, Jun 18, 2026 at 02:36:25PM +0200, David Hildenbrand (Arm) wrote:

Hi, David

[...]

>Best to wait for some feedback.

Sure.

>I do wonder whether we want to pass an address instead of a page.
>
>https://lore.kernel.org/r/20260410151746.61150-2-kalyazin@xxxxxxxxxx
>
>Wants to convert existing ones as well.
>
>That would imply that the caller must check for highmem.
>
>But then, we could just use existing set_memory_ro(), right?
>

Agreed. Passing an address and reusing the existing set_memory_ro()
definitely makes things simpler.

However, there is an arm64 specific limitation:
currently, the set_memory_r* api on arm64 only support the vmap
region and do not handle linear map addresses.

If we go this route, should I extend the arm64 set_memory_r*
implementation in the next version? The plan would be to make it check
for the bblm2 feature and modify the linear map PTEs accordingly.
What do you think?

Thanks,
Xueyuan