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

Xueyuan Chen xueyuan.chen21 at gmail.com
Thu Jul 9 20:03:41 PDT 2026


On Tue, Jul 07, 2026 at 06:17:12AM -0700, Usama Arif wrote:

Hi Usama,

Sorry for the late reply.

[...]

>Can this really skip the TLB flush here?  This runs from a
>subsys_initcall, after smp_init() and after the folio was allocated and
>zeroed through the writable direct map.  The noflush helper updates the
>direct-map PTEs but does not invalidate stale writable kernel TLB entries.
>
>I think we need a TLB flush here?

I checked the code, and you are right. This runs after smp_init(), and
the folio has already been allocated and zeroed through the writable
direct map before changing the direct-map PTEs. So skipping the TLB
flush is not safe.

I will fix this in the next version.

Thanks for catching this.

Thanks,
Xueyuan



More information about the linux-arm-kernel mailing list