]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
ethtool: reduce stack usage with clang
authorArnd Bergmann <arnd@arndb.de>
Thu, 7 Mar 2019 15:58:35 +0000 (16:58 +0100)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 14 Feb 2020 05:29:37 +0000 (00:29 -0500)
commit0f10a4167440517690d3d1bd967d02d269bacf48
tree4e094516f9c3fdad69b4a9ac4eafc42e864c24f4
parenta98b605d081da3e6048b8a1d39b57d51b9a2a410
ethtool: reduce stack usage with clang

BugLink: https://bugs.launchpad.net/bugs/1861934
commit 3499e87ea0413ee5b2cc028f4c8ed4d424bc7f98 upstream.

clang inlines the dev_ethtool() more aggressively than gcc does, leading
to a larger amount of used stack space:

net/core/ethtool.c:2536:24: error: stack frame size of 1216 bytes in function 'dev_ethtool' [-Werror,-Wframe-larger-than=]

Marking the sub-functions that require the most stack space as
noinline_for_stack gives us reasonable behavior on all compilers.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Michal Kubecek <mkubecek@suse.cz>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Miles Chen <miles.chen@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
net/core/ethtool.c