Re: [RFC 00/14] Dynamic Kernel Stacks

From: Kent Overstreet
Date: Thu Mar 14 2024 - 15:29:16 EST


On Thu, Mar 14, 2024 at 03:23:08PM -0400, Pasha Tatashin wrote:
> > >
> > > 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].

Raw number doesn't mean much here (I know how many machines Google has,
of course it's going to be petabytes ;), percentage of system memory
would be better.

What I'd _really_ like to see is raw output from memory allocation
profiling, so we can see how much memory is going to kernel stacks vs.
other kernel allocations.

Number of kernel threads vs. number of user threads would also be good
to know - I've been seeing ps output lately where we've got a lot more
workqueue workers than we should, perhaps that's something that could be
addressed.