> > > > My point is that what matters is total memory use, not just memory used in > > the kernel. Amdahl's law. > > If userspace is running a few processes with many threads and the > userspace stacks are small, kernel stacks could end up dominating. > > I'd like to see some numbers though. The unused kernel stack pages occupy petabytes of memory across the fleet [1]. I also submitted a patch [2] that can help visualize the maximum stack page access distribution. [1] https://lore.kernel.org/all/CA+CK2bBYt9RAVqASB2eLyRQxYT5aiL0fGhUu3TumQCyJCNTWvw@xxxxxxxxxxxxxx [2] https://lore.kernel.org/all/20240314145457.1106299-1-pasha.tatashin@xxxxxxxxxx