STAMINA - Linux Kernel Stack Monitoring tool https://github.com/milabs/stamina by Ilya Matveychikov
-
-
Replying to @solardiz
Noob here - trying to understand what this is doing and why should one do it. If I understand this correctly, this creates a mapping that shows the min/max kernel stack size of each syscall for the calling process and the number of hits. As for why - isn't perf good enough?
1 reply 0 retweets 1 like -
Replying to @guye1296
I'm not up to date on relevant detail, but since you ask: Kernel stacks are tiny and overflowing them either overwrites other data or crashes, see
@kees_cook's description of a relevant change: https://outflux.net/blog/archives/2016/12/12/security-things-in-linux-v4-9/ … Can you monitor kernel stack usage via perf? I don't know.2 replies 0 retweets 0 likes -
On reasonably modern x86-64 (>=4.9) and arm64 (>=4.14) kernels with a normal kernel config (VMAP_STACK=y), task stacks are mapped with guard pages around them, so overflows are not a concern.
1 reply 0 retweets 0 likes -
Nowadays at least on x86-64 the percpu exception stacks (used for double faults and NMIs and such) are allocated with guard holes, too; see percpu_setup_exception_stacks() (but that's newer, only in >=5.2)
1 reply 0 retweets 2 likes
if you want to monitor kernel stack usage is on your system, you can turn on CONFIG_DEBUG_STACK_USAGE; that prints into dmesg which task has used the maximum amount of stack space and how much is left, and you can dump the maximum stack usage of each task via sysrq
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.