[PATCH 5/5] mm: Do not map the shadow stack as THP
Mark Brown
broonie at kernel.org
Wed Feb 25 08:10:18 PST 2026
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:
> > 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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20260225/c2b76f22/attachment.sig>
More information about the linux-arm-kernel
mailing list