[RFC PATCH 06/15] exit: Don't assume the kernel stack size

From: Mostafa Saleh

Date: Mon Sep 28 2026 - 13:55:23 EST


check_stack_usage() assumes that the kernel stack size is THREAD_SIZE.
The allocated kernel stack size may not be THREAD_SIZE anymore, rely
on the newly introduced helpers task_stack_size()

Signed-off-by: Mostafa Saleh <smostafa@xxxxxxxxxx>
---
kernel/exit.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/exit.c b/kernel/exit.c
index 424c44a42a4d..899d3bf048d4 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -883,7 +883,7 @@ static void check_stack_usage(void)
unsigned long free;

free = stack_not_used(current);
- kstack_histogram(THREAD_SIZE - free);
+ kstack_histogram(task_stack_size(current) - free);

if (free >= lowest_to_date)
return;
--
2.56.0.rc1.315.gc6ed9934b7-goog