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.