From: Lance Yang <lance.yang@linux.dev>
To: "David Hildenbrand (Arm)" <david@kernel.org>,
Dave Hansen <dave.hansen@intel.com>,
Xueyuan chen <xueyuan.chen21@gmail.com>
Cc: linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, x86@kernel.org,
catalin.marinas@arm.com, will@kernel.org, tglx@kernel.org,
mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com,
hpa@zytor.com, ljs@kernel.org, ziy@nvidia.com,
baolin.wang@linux.alibaba.com, akpm@linux-foundation.org,
ryan.roberts@arm.com, dev.jain@arm.com,
yang@os.amperecomputing.com, jannh@google.com,
linux-mm@kvack.org
Subject: Re: [RFC PATCH 1/3] mm: make persistent huge zero folio read-only
Date: Mon, 1 Jun 2026 23:43:56 +0800 [thread overview]
Message-ID: <bbecce76-c677-4045-b0d1-ba822b84dcf5@linux.dev> (raw)
In-Reply-To: <929875a2-9e94-4dbc-9c98-b342ccc3f4e2@kernel.org>
On 2026/6/1 21:49, David Hildenbrand (Arm) wrote:
> On 5/27/26 17:55, Dave Hansen wrote:
>> On 5/26/26 20:56, Xueyuan chen wrote:> +#ifdef
>> CONFIG_READONLY_HUGE_ZERO_FOLIO
>>> +bool __init arch_make_huge_zero_folio_readonly(struct folio *folio);
>>> +#endif
>>
>> All of the #ifdeffery needs to die, IMNHO.
>>
>> This function is also a bad idea. There is nothing "huge zero" specific
>> about it. It takes any old folio and tries to make it read only.
>>
>> Just make it:
>>
>> bool __init arch_make_folio_readonly(struct folio *folio)
>>
>
> I'm not sure whether we want a folio-based interface, though.
>
> This will likely be the only folio (that will actually have a "struct folio" in
> the future) compound page we'll ever mark read-only ... whereby I'd guess we'd
> want other non-folio pages to be read-only in the future (encryption keys etc,
> maybe?).
>
> So I'd instead use a page-range based interface or sth like that.
Just to check, did you mean something like:
bool arch_make_pages_readonly(struct page *page, int nr_pages);
?
So it can work on pages as well, not only folios :)
next prev parent reply other threads:[~2026-06-01 15:44 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-27 3:56 [RFC PATCH 0/3] make persistent huge zero folio read-only Xueyuan chen
2026-05-27 3:56 ` [RFC PATCH 1/3] mm: " Xueyuan chen
2026-05-27 13:32 ` Dev Jain
2026-05-27 23:03 ` Xueyuan Chen
2026-05-27 15:55 ` Dave Hansen
2026-05-27 16:20 ` Jann Horn
2026-05-28 18:43 ` Yang Shi
2026-05-29 3:09 ` Lance Yang
2026-06-01 13:49 ` David Hildenbrand (Arm)
2026-06-01 15:43 ` Lance Yang [this message]
2026-06-01 15:46 ` David Hildenbrand (Arm)
2026-05-27 3:56 ` [RFC PATCH 2/3] arm64/mm: make huge zero folio read-only in linear map Xueyuan chen
2026-05-27 3:56 ` [RFC PATCH 3/3] x86/mm: make huge zero folio read-only in direct map Xueyuan chen
2026-05-27 15:58 ` [RFC PATCH 0/3] make persistent huge zero folio read-only Dave Hansen
2026-05-30 7:46 ` Lance Yang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bbecce76-c677-4045-b0d1-ba822b84dcf5@linux.dev \
--to=lance.yang@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=bp@alien8.de \
--cc=catalin.marinas@arm.com \
--cc=dave.hansen@intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=david@kernel.org \
--cc=dev.jain@arm.com \
--cc=hpa@zytor.com \
--cc=jannh@google.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ljs@kernel.org \
--cc=mingo@redhat.com \
--cc=ryan.roberts@arm.com \
--cc=tglx@kernel.org \
--cc=will@kernel.org \
--cc=x86@kernel.org \
--cc=xueyuan.chen21@gmail.com \
--cc=yang@os.amperecomputing.com \
--cc=ziy@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox