Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8603683ybl; Thu, 16 Jan 2020 20:42:11 -0800 (PST) X-Google-Smtp-Source: APXvYqxkyODpbTDfB+71/kma6nfuB8T0NJGSB3beuPGwohpDyXL0xCmoEUcfkpTsnYOs2iygOOka X-Received: by 2002:a05:6830:1481:: with SMTP id s1mr1385229otq.66.1579236131523; Thu, 16 Jan 2020 20:42:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579236131; cv=none; d=google.com; s=arc-20160816; b=JKzSqmiOgEg5MIHCYEXLsxjB9+0uMA434zsi45oBWe0DkNCQnotHC2pXB4C277GAO/ vYsjWRwEC5YEIhiuDbtV/0JUP7wgUhIeBFn9DMFJBn37pVDraItngCD+QnCx6CVyI5vV NyTnEHXGM3nOPru/lRklTCRTTD7XLyAuSB8BYqrwJmh2fhVMHH3TyDe4yGOcfyAQjGmU zcjbwNyNQ6uol3iYRRB3rqzaxFQRo948SEMzKlZbkDW/Y86zd/hxrTVZuqcnh0QaFa4M slX8K2qcLN/EzDIm2/w63kkBdMZ9egeDmYnWbribLhshcoCG3drYbM+pr8TrxTZRV3B5 TR0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=fW25JW6XL++vPxsW+/ElFAY4PNTrtwvBvL/+Qh8NFOI=; b=wi3ahmPtHY5RzYsHOz2P2ABrzVQytxWWzWciNqA5dheIvnz7HOHZ37ygxJs79exzUH dwJIyIZp3I98PK/UJ5j+KpPKH/MYgMbg9je2FRHUgtNWvoLY+jdVmrX+wXWiIJr9hIp5 lAZE2u0Rtw4HILkCxl6/3L/YGR9Cv3FwwES6kpWnkKgm0pdhCHt5vR900SvWdzHZvrMl dGR123M9phK3qt11HFokNRt2ZSaNqRX9M3CA4tZxTfuI+YvEX9EPNFjj7c5GGuzXTvAh +9Acp8l0fqX/qzHdCMgGEFM+LU3ymeENV7RXH7wV99/YzZJsYQDYAYIZ8fQNCgatJQu0 TRSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jKrMYGtG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q6si14865740oth.26.2020.01.16.20.41.59; Thu, 16 Jan 2020 20:42:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jKrMYGtG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404173AbgAPXb7 (ORCPT + 99 others); Thu, 16 Jan 2020 18:31:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:40412 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391482AbgAPXbp (ORCPT ); Thu, 16 Jan 2020 18:31:45 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7D12420661; Thu, 16 Jan 2020 23:31:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579217505; bh=h+byEWvsgdhemHu13KACwa/7kqTpPFzXgZyL0H2/qjk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jKrMYGtGA0bso20U8ZQs7SzMVbycSCqkQwjpwQk3BLjBUMF9hsPFW/++FFCkbCJZR 1yGHMGJF00oa1jL45+3qnAaCahiZb8GBMdNT3T4EDl8cW4RFNGsGyws1FGiFp4vocW 54cEJWHqe3+fOr/CQFUBIMEJYko4GS+WNUgw5VTo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Michal Kubecek , "David S. Miller" , Miles Chen Subject: [PATCH 4.14 04/71] ethtool: reduce stack usage with clang Date: Fri, 17 Jan 2020 00:18:02 +0100 Message-Id: <20200116231710.044940260@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200116231709.377772748@linuxfoundation.org> References: <20200116231709.377772748@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann 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 Reviewed-by: Michal Kubecek Signed-off-by: David S. Miller Signed-off-by: Miles Chen Signed-off-by: Greg Kroah-Hartman --- net/core/ethtool.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) --- a/net/core/ethtool.c +++ b/net/core/ethtool.c @@ -2343,9 +2343,10 @@ static int ethtool_set_tunable(struct ne return ret; } -static int ethtool_get_per_queue_coalesce(struct net_device *dev, - void __user *useraddr, - struct ethtool_per_queue_op *per_queue_opt) +static noinline_for_stack int +ethtool_get_per_queue_coalesce(struct net_device *dev, + void __user *useraddr, + struct ethtool_per_queue_op *per_queue_opt) { u32 bit; int ret; @@ -2375,9 +2376,10 @@ static int ethtool_get_per_queue_coalesc return 0; } -static int ethtool_set_per_queue_coalesce(struct net_device *dev, - void __user *useraddr, - struct ethtool_per_queue_op *per_queue_opt) +static noinline_for_stack int +ethtool_set_per_queue_coalesce(struct net_device *dev, + void __user *useraddr, + struct ethtool_per_queue_op *per_queue_opt) { u32 bit; int i, ret = 0; @@ -2434,7 +2436,7 @@ roll_back: return ret; } -static int ethtool_set_per_queue(struct net_device *dev, +static int noinline_for_stack ethtool_set_per_queue(struct net_device *dev, void __user *useraddr, u32 sub_cmd) { struct ethtool_per_queue_op per_queue_opt;