Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8518483ybl; Thu, 16 Jan 2020 18:37:42 -0800 (PST) X-Google-Smtp-Source: APXvYqxr6/AxvObQRRNDLg7+//SIboGhWVBzIJCvQuGWzDiQlxC8RGOh6BTbkiy1YQp80V3C8Zh5 X-Received: by 2002:aca:db56:: with SMTP id s83mr1837591oig.171.1579228661958; Thu, 16 Jan 2020 18:37:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579228661; cv=none; d=google.com; s=arc-20160816; b=AY44BGkf6NKUUPMZsz+YoS7vO/j5orgyKO2VeadCrzYx5iNxIlt2j4cCLL/u3zSuj3 hfJ51j5P125E/EI5dcb9OF3bsNBsJFZNLuqx5YV24/SeP4CtCirvR450nnW3irr5LmAJ Ey9CDSkzk9YoelWrPVOzKT9EFOGQ08zljusk3zAx7oNqmGNhpFG8CZS78Se0lyymMf4Z 13VAS81mncwKRQmSoWLXUBHdsd8nk3eYXyVscLj/FfS8+ji7DR6ktnepsPbymDLIV7KU PkBxQs1CRqeGP5y1LhTAgXkDoDvDpTGS2XcLvdJ8c5Z1ec20O5TMa9PQnvW6vfvQHplQ MiHw== 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=fX9AFMFUl3JzJJrtdNOajUiVD/dIx2BhjRTYTVKBaqE=; b=YyUgC5+45dkuOptLBIzfdgp1Uodvi+CNSbpsvBAd9JQ35xLqZcWZKEtYhIRs+gha4s I7M2/Ljlcs2XoxvYJU91nmSQIFiVBkXWPEyOdXsjeIe/2lyUd96j9OgXs9tWewlTqCeD bh/X0sD61Ru132mKr/GYgacGt2QQRxCjMEZiU7TGZjS76fhzFRV8dCj+0eCxx81qsV8v s70sR6xLyvvs9C+6NJTa2o9EsIM1dNT1maJLFkcxuQUSvTBqS4s1BUmnyIEPxCQ6+JFn Ya16V9comfGL3vc+rq9FWdu8+Z2+AHudqtLPZzoTc80GPnXhai5XHxc0p9ZGV4wafS44 Sl9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=CzUK44a6; 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 o4si12902291otp.200.2020.01.16.18.37.30; Thu, 16 Jan 2020 18:37:41 -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=CzUK44a6; 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 S2388697AbgAPX2c (ORCPT + 99 others); Thu, 16 Jan 2020 18:28:32 -0500 Received: from mail.kernel.org ([198.145.29.99]:33206 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389402AbgAPX2a (ORCPT ); Thu, 16 Jan 2020 18:28:30 -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 154D820684; Thu, 16 Jan 2020 23:28:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579217308; bh=K7nuYz1eNgGESYAGCl+dzAzfUti/VATJU0c//XrLoB4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CzUK44a679LmB6FQku9xY9/cArJRLW97tlvvwqSR8JgycF2FZ87dgJyMeHZcQQNvp nzdMbz2kNxijDz2LbCGM0kDog0vV2Cf9Wyp3k6PZ/TCoMTtTVslIWbjidy3PyNnwyl LqOVgx8Cl4X1seFv7lClHfYzRI29btGrejUM7Rcc= 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.19 04/84] ethtool: reduce stack usage with clang Date: Fri, 17 Jan 2020 00:17:38 +0100 Message-Id: <20200116231713.857936861@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200116231713.087649517@linuxfoundation.org> References: <20200116231713.087649517@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 @@ -2413,9 +2413,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; @@ -2443,9 +2444,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; @@ -2499,7 +2501,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;