google / kernel-sanitizers

Linux Kernel Sanitizers, fast bug-detectors for the Linux kernel
https://google.github.io/kernel-sanitizers/
442 stars 87 forks source link

[kfence] Reconsider using stack depot #66

Closed ramosian-glider closed 4 years ago

ramosian-glider commented 4 years ago

It is nice that we don't have to invent our own storage for stack traces, but stackdepot may increase our memory footprint, as it does not garbage collect stacks.

It is actually enough to allocate KFENCE_STACK_DEPTH * 8 bytes * 2 for alloc/free stacks * 256 objects bytes once and overwrite old stacks as objects get reused.

dvyukov commented 4 years ago

I agree, I think we should not use stack depot for KFENCE.