]> www.infradead.org Git - users/willy/xarray.git/commit
net: reduce rtnetlink_rcv_msg() stack usage
authorEric Dumazet <edumazet@google.com>
Wed, 10 Jul 2024 15:16:53 +0000 (15:16 +0000)
committerJakub Kicinski <kuba@kernel.org>
Fri, 12 Jul 2024 00:13:58 +0000 (17:13 -0700)
commitcef4902b0fadfc4181176ef5713f0b7cf2a40d8f
tree05b9cc1dd265e2c35070b570e13b5cfcd6044958
parentb07593edd2faf310f9b758896f4f1c6054515be4
net: reduce rtnetlink_rcv_msg() stack usage

IFLA_MAX is increasing slowly but surely.

Some compilers use more than 512 bytes of stack in rtnetlink_rcv_msg()
because it calls rtnl_calcit() for RTM_GETLINK message.

Use noinline_for_stack attribute to not inline rtnl_calcit(),
and directly use nla_for_each_attr_type() (Jakub suggestion)
because we only care about IFLA_EXT_MASK at this stage.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20240710151653.3786604-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/core/rtnetlink.c