Re: [PATCH v2 00/13] Dynamic Kernel Stacks

From: Zach O'Keefe

Date: Mon Jun 29 2026 - 13:41:14 EST


Thanks All.

Yes, we run with CONFIG_DEBUG_STACK_USAGE -- which allows us to put
together information on max stack depth usage per host/task.

I'd like to create an upstream recipe for finding deep stacks
statically by combining per-frame sizes from --fstack-usage with
callgraphs generated using Dan Carpenter's smatch utility. In
particular, smatch's selling point is the ability to track indirect
calls (i.e., calls through vm_operations, super_operations, etc).
While easy to set up, and working well out-of-the-box, this currently
results in many false-positive callstack possibilities, so I'm trying
to pare down the graph to get to some useable data. Additionally will
need to know what exception-originating stacks can possibly be
superimposed on the base callstack, for the given configuration -- for
example, today, only a few places we'd expect to see #PF stack.
Lastly, I've been analyzing perf-like data to authoritatively
construct the call graphs as well -- or at least to use for
seeding/filtering the static call graph.

Thanks,
Zach