@marcan the variable stack allocation does seem promising, and I had similar ideas in the past but never implemented those. What is particularly nice about them is that on kernels with 4KB pages, you can almost always get away with one or two pages instead of four then, so it saves physical memory at the same time as allowing larger stacks. When using 16KB page size, it obviously won't save anything.