Re: [PATCH] mm/damon/core: reduce kernel stack usage
From: SeongJae Park
Date: Thu Jun 11 2026 - 09:56:25 EST
On Thu, 11 Jun 2026 14:56:57 +0200 Arnd Bergmann <arnd@xxxxxxxxxx> wrote:
> From: Arnd Bergmann <arnd@xxxxxxxx>
>
> The main thread function has recently grown to the point of
> exceeding stack frame size warning limits in some configurations.
> This is what I hit on s390 with clang and CONFIG_KASAN:
>
> mm/damon/core.c:3440:31: error: stack frame size (1352) exceeds limit (1280) in 'kdamond_fn' [-Werror,-Wframe-larger-than]
> 3440 | static int kdamond_fn(struct damon_ctx *ctx)
>
> The largest stack usage here is inside of the kdamond_tune_intervals(),
> so by marking that one as noinline_for_stack, the functions individually
> stay below the warning limit, though kdamond_fn() itself still uses
> hundreds of kilobytes for some reason.
Thank you for this fix, Arnd! I will also take a look in kdamond_fn() to see
if there are more things to reduce.
>
> Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
Reviewed-by: SeongJae Park <sj@xxxxxxxxxx>
Should we add Fixes: and Cc: stable@ too? This function was introduced by
commit f04b0fedbe71 ("mm/damon/core: implement intervals auto-tuning") which
was merged into 6.15.
Thanks,
SJ
[...]