Skip to contentSkip to conversation

stackdepot: Make max number of pools boot-time configurable

PATCH New Matt Fleming 1 participant 1 message Jul 31, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v5 1/1 stackdepot: Make max number of pools boot-time configurable

From: Matt Fleming <[email protected]>

We're hitting the WARN in depot_init_pool() about reaching the stack depot limit because we have long stacks that don't dedup very well.

Introduce a new start-up parameter to allow users to set the number of maximum stack depot pools.

---

Changes in v5:
- Add Acked-by tags
- Document magic number as STACK_MIN_POOLS
- Clamp out of bounds stack_depot_max_pools values instead of using default
- Don't blindly follow clang-format

Changes in v4:
- Simplify initial stack_max_pools value courtesy of akpm

Changes in v3:
- Switch from build-time to boot-time parameter

Changes in v2:
- Replace BUILD_BUG_ON with static_assert()
- Hide STACKDEPOT_MAX_POOLS behind EXPERT

 .../admin-guide/kernel-parameters.txt         |  5 ++
 lib/stackdepot.c                              | 64 ++++++++++++++++---
 2 files changed, 60 insertions(+), 9 deletions(-)
Documentation/admin-guide/kernel-parameters.txt +5 -0
index 07e22ba5bfe3..273f6bbd56c2 100644
@@ -6988,6 +6988,11 @@
 			consumed by the stack hash table. By default this is set
 			to false.
 
+	stack_depot_max_pools= [KNL,EARLY]
+			Specify the maximum number of pools to use for storing
+			stack traces. Pools are allocated on-demand up to this
+			limit. Default value is 8191 pools.
+
 	stacktrace	[FTRACE]
 			Enabled the stack tracer on boot up.
 
lib/stackdepot.c +55 -9

107 lines not on this page · raw message

Signature · 1 line
2.34.1