Re: lib/overflow_kunit.c:644:1: warning: the frame size of 2832 bytes is larger than 1024 bytes

From: Daniel Latypov
Date: Mon Jun 13 2022 - 15:31:09 EST


On Sat, Jun 11, 2022 at 9:44 AM kernel test robot <lkp@xxxxxxxxx> wrote:
>
> Hi Kees,
>
> First bad commit (maybe != root cause):
>
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: 0885eacdc81f920c3e0554d5615e69a66504a28d
> commit: 617f55e20743fc50c989b498f9dee289eb644cfd lib: overflow: Convert to Kunit
> date: 3 months ago
> config: powerpc-buildonly-randconfig-r006-20220611 (https://download.01.org/0day-ci/archive/20220612/202206120046.YKeKzlVN-lkp@xxxxxxxxx/config)
> compiler: powerpc-linux-gcc (GCC) 11.3.0
> reproduce (this is a W=1 build):
> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=617f55e20743fc50c989b498f9dee289eb644cfd
> git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> git fetch --no-tags linus master
> git checkout 617f55e20743fc50c989b498f9dee289eb644cfd
> # save the config file
> mkdir build_dir && cp config build_dir/.config
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross W=1 O=build_dir ARCH=powerpc SHELL=/bin/bash
>
> If you fix the issue, kindly add following tag where applicable
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
>
> All warnings (new ones prefixed by >>):
>
> lib/overflow_kunit.c:191:19: warning: 's64_tests' defined but not used [-Wunused-const-variable=]
> 191 | DEFINE_TEST_ARRAY(s64) = {
> | ^~~
> lib/overflow_kunit.c:24:11: note: in definition of macro 'DEFINE_TEST_ARRAY'
> 24 | } t ## _tests[]
> | ^
> lib/overflow_kunit.c:94:19: warning: 'u64_tests' defined but not used [-Wunused-const-variable=]
> 94 | DEFINE_TEST_ARRAY(u64) = {
> | ^~~
> lib/overflow_kunit.c:24:11: note: in definition of macro 'DEFINE_TEST_ARRAY'
> 24 | } t ## _tests[]
> | ^
> lib/overflow_kunit.c: In function 'overflow_size_helpers_test':
> >> lib/overflow_kunit.c:644:1: warning: the frame size of 2832 bytes is larger than 1024 bytes [-Wframe-larger-than=]
> 644 | }
> | ^
> lib/overflow_kunit.c: In function 'overflow_shift_test':
> lib/overflow_kunit.c:451:1: warning: the frame size of 7232 bytes is larger than 1024 bytes [-Wframe-larger-than=]
> 451 | }
> | ^

I have an RFC series out to reduce the stack usage of KUNIT_EXPECT_*
even further, but they won't help enough here.
https://lore.kernel.org/linux-kselftest/20220525154442.1438081-1-dlatypov@xxxxxxxxxx/

So If we want to try and "fix" this, I think the only answer would be
to split up the test funcs as appropriate.
But I don't really know if that's warranted to fix this warning here,
which largely indicates a compiler quality problem over a code quality
one.

Daniel