Thread (21 messages) 21 messages, 5 authors, 2026-02-25

Re: [PATCH 5/5] mm: Do not map the shadow stack as THP

From: Mark Brown <broonie@kernel.org>
Date: 2026-02-25 16:10:24
Also in: linux-mm, linux-riscv, lkml

On Wed, Feb 25, 2026 at 03:51:20PM +0000, Catalin Marinas wrote:
On Wed, Feb 25, 2026 at 01:02:36PM +0000, Mark Brown wrote:
quoted
The create THP and immediately splitting it pattern is very clear when
checking the mm behaviour on new GCSs, this should help performance.
If the first access is a write, the kernel allocates a THP from the
start without subsequent splitting. Also since 6.13 (commit 1ced09e0331f
Ah, it seems this has been optimised since I looked in detail - it was
something I was aware of as needing some work.
"mm: allocate THP on hugezeropage wp-fault"), we go for another THP on
write. It's still wasting memory and time to zero the full 2MB when
it's highly unlikely we'd ever use that much for a shadow stack.
Yeah, for a shadow stack I'd be surprised if it wasn't cheaper to split
than do all that.

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help