]> www.infradead.org Git - users/willy/xarray.git/commit
mm/damon/lru_sort: adjust local variable to dynamic allocation
authorPeng Hao <flyingpeng@tencent.com>
Tue, 23 Jul 2024 03:55:13 +0000 (11:55 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 2 Sep 2024 03:25:45 +0000 (20:25 -0700)
commitc39542732a3d84e851a0ab8ff3106ed3138174a0
tree3579156c50ad6bf85eecf400a2f31880c9fb4638
parentc2a967f6ab0ec896648c0497d3dc15d8f136b148
mm/damon/lru_sort: adjust local variable to dynamic allocation

When KASAN is enabled and built with clang:
    mm/damon/lru_sort.c:199:12: error: stack frame size (2328) exceeds
limit (2048) in 'damon_lru_sort_apply_parameters' [-Werror,-Wframe-larger-than]
    static int damon_lru_sort_apply_parameters(void)
               ^
    1 error generated.

This is because damon_lru_sort_quota contains a large array, and
assigning this variable to a local variable causes a large amount of
stack space to be occupied.

So adjust local variable to dynamic allocation.

Link: https://lkml.kernel.org/r/20240723035513.20153-1-flyingpeng@tencent.com
Signed-off-by: Peng Hao <flyingpeng@tencent.com>
Reviewed-by: SeongJae Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/damon/lru_sort.c