Re: [PATCHv7 13/18] mm: Drop fake head checks

From: Kiryl Shutsemau

Date: Wed Oct 28 2026 - 09:05:05 EST


On Wed, Oct 28, 2026 at 10:38:22AM +0800, Muchun Song wrote:
> > Bootmem folios optimized in early boot get their tails mapped writable
> > and write protected later. Drop the write protect step.
>
> For bootmem folios, I don't think the RO mapping should be removed,
> because we are in the initialization stage of struct page.
> No one should touch those pages at this point; otherwise, they could
> encounter uninitialized struct page as well. This assumes no race
> exists during early boot.
>
> Since such a problem does not exist during the boot stage, why should
> we give up the protection that RO provides?

Agreed. Nothing does a lockless get on bootmem folios before hugetlb
takes them, so they can stay RO.

I will keep the pre-HVO write-protect and post the patch.

--
Kiryl Shutsemau / Kirill A. Shutemov