v1 2026-08-17

stack depot 引入路径压缩 trie · v1

为持久化 stack depot 记录增加可选的路径压缩 trie 后端,共享相同帧序列,避免重复存储耗尽固定池预算。

原始补丁链接

子 Patch(9)

1/9
stackdepot: share persistent stack prefixes with trie storage
为stackdepot增加path-compressed trie后端,使持久化栈记录共享公共帧前缀,提高池利用率;用handle中无效pool-index编码ID,side table映射,并添加架构相关紧凑帧存储。
2/9
stackdepot: add KUnit tests for trie storage
为stackdepot trie存储增加KUnit测试,覆盖保存去重、超长栈、分配失败、fetch/格式化及trie拓扑变更路径,并验证旧handle在分裂/提升后仍可获取和去重。
3/9
mm/page_owner: preserve accounting with countable stack depot records
为page_owner增加STACK_DEPOT_FLAG_COUNTABLE标志,强制其记录留在hash后端以维持稳定record指针和count计数;新增u16 flags字段,拒绝countable记录调用put,并保持record头大小不变。
4/9
mm/kmemleak: print trie-backed stack depot traces
kmemleak改用stack_depot_fetch_into()将trie-backed handle物化到MAX_TRACE本地数组,避免因stack_depot_fetch()不支持trie而丢失泄漏报告中的backtrace。
5/9
kmsan: report trie-backed stack depot traces
KMSAN改用stack_depot_fetch_into()和KMSAN_STACK_DEPTH数组物化origin与chain栈,保存链头/next handle防覆盖,并因fetch_into已unpoison而移除冗余解除毒化。
6/9
mm/slub: materialize trie-backed stack depot traces
SLUB的__kmem_obj_info()及alloc/free_traces改用stack_depot_fetch_into()配合TRACK_ADDRS_COUNT数组,以支持trie-backed handles,并保持原有输出格式和限制。
7/9
drm/locking: preserve deadlock diagnostics for trie-backed stacks
DRM modeset lock死锁诊断改用stack_depot_snprint()格式化保存的栈,替代仅支持hash后端的stack_depot_fetch(),使trie-backed handles也能输出诊断。
8/9
scripts/gdb: reject trie-backed stack depot handles
GDB lx-stack_depot_lookup增加对pool_index_plus_1 > stack_max_pools的检查,拒绝trie-backed handle,避免将其误判为hash pool索引而错误报告。
9/9
stackdepot: add boot-time activation for trie storage
新增boot参数stackdepot.trie_enabled(默认关闭)及static key选择后端,trie ID与hash共用pool-index字段,需相应调整stack_depot_max_pools,以避免handle空间冲突。