]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
RDMA/core: reduce stack using in nldev_stat_get_doit()
authorArnd Bergmann <arnd@arndb.de>
Fri, 20 Jun 2025 11:33:26 +0000 (13:33 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Aug 2025 14:28:27 +0000 (16:28 +0200)
commit8c449e588d8188d065df59b33920d465c9900442
tree3a63bf11374589a4cf0e09a1ae5c5779aa793a88
parent89fdac333a17ed990b41565630ef4791782e02f5
RDMA/core: reduce stack using in nldev_stat_get_doit()

[ Upstream commit 43163f4c30f94d2103c948a247cdf2cda5068ca7 ]

In the s390 defconfig, gcc-10 and earlier end up inlining three functions
into nldev_stat_get_doit(), and each of them uses some 600 bytes of stack.

The result is a function with an overly large stack frame and a warning:

drivers/infiniband/core/nldev.c:2466:1: error: the frame size of 1720 bytes is larger than 1280 bytes [-Werror=frame-larger-than=]

Mark the three functions noinline_for_stack to prevent this, ensuring
that only one copy of the nlattr array is on the stack of each function.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://patch.msgid.link/20250620113335.3776965-1-arnd@kernel.org
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/core/nldev.c