Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp3260321ybd; Fri, 28 Jun 2019 05:42:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqyiFxtBWJWjLQ/+ljTAdQgrVDIVrWaekMPS/IGrME2J2jxqhQRDWOijTQJC+ur/6ehHNylD X-Received: by 2002:a17:90a:ab0b:: with SMTP id m11mr13383829pjq.73.1561725722570; Fri, 28 Jun 2019 05:42:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561725722; cv=none; d=google.com; s=arc-20160816; b=XP/6U8ZLGgBK0sSSbChYFAsuRYSr8nwQdeEU3d7bON3ZY3/g3lQz2CLNfG/G6Z1XuH FjerJjEdrQpK0bWJr3z/HYw7uebErKZc4Ve/JDV0mW2fhjHA1x5RL5cu6Jy4WEZYGyEg H/wukXV16/UjE/06pLPDqNspEgXQnIES80qa1IvdpsFZDW0lpdgLJxKdFrxLQCXCjP1k 97iMeU+a6K6mEQe6yF07oIcQ3RCWXKllGAH5vNw19i5OwXdx11q/AjoZJRU0nEWWzED1 7I8Y5WQfKCRc9vtZy+cvBOMtzl9fjSFvm2gQ98c4y1WsA6abyGcEJDXr3dhqgyf950pM XKIg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=sliLDlf4LDTH55cjmJACsoKpJ97ma1HQjTXk0RzTObk=; b=0V6Srw6Rhq5U22WwNzI+I2TYFPd91w/BMadSEAUcOMYOfwrXgjzCTQOYfxtX+81/dL Y5eG/xrgbYmeYBr+oiH/2NlbHDDy7yrv7DoLdmVXqtZZ3YgpeEtRJfRFJu1saivxWzFj 8duiNbjLElLi0olXWyQzTHRU04tpysRw/N6f7pcm9vMNcOhAMH9joaQqgCzkaHuGgFDF U03CGLojpQ+Jr5GrMEKTJ4EROgAJUMYTun+GcPFrVc3oZqN8ufCpGfCznQQiYwFsmAg/ SqDhNw+oEEQWetFCdFKoxBB+uyOX5rO6rl+9o3w1MrebMW9GGtZmdl1GY8poh3icKueW Hklg== ARC-Authentication-Results: i=1; mx.google.com; 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 bf7si1952817plb.216.2019.06.28.05.41.46; Fri, 28 Jun 2019 05:42:02 -0700 (PDT) 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; 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 S1727137AbfF1MkE (ORCPT + 99 others); Fri, 28 Jun 2019 08:40:04 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:48763 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726657AbfF1MkE (ORCPT ); Fri, 28 Jun 2019 08:40:04 -0400 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.145]) with ESMTPA (Nemesis) id 1MDyoU-1hoZvO22oG-009wgv; Fri, 28 Jun 2019 14:38:46 +0200 From: Arnd Bergmann To: Kees Cook , James Smart , Dick Kennedy , "James E.J. Bottomley" , "Martin K. Petersen" Cc: Larry Finger , Florian Schilhabel , Greg Kroah-Hartman , "David S . Miller" , Wensong Zhang , Simon Horman , Julian Anastasov , Pablo Neira Ayuso , James Morris , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org, netdev@vger.kernel.org, lvs-devel@vger.kernel.org, netfilter-devel@vger.kernel.org, coreteam@netfilter.org, Ard Biesheuvel , Arnd Bergmann , Hannes Reinecke , Willy Tarreau , Silvio Cesare Subject: [PATCH 2/4] lpfc: reduce stack size with CONFIG_GCC_PLUGIN_STRUCTLEAK_VERBOSE Date: Fri, 28 Jun 2019 14:37:47 +0200 Message-Id: <20190628123819.2785504-2-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20190628123819.2785504-1-arnd@arndb.de> References: <20190628123819.2785504-1-arnd@arndb.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:Qw9p6hkVU7HnncabkXeSvgIHyGWrL89skKuFPCZp3XZbO0Z/qwl 1txNbL56ftqBS+LSOFslqsBvdmgKMoeVtc5vuNivf1x/Hgk6rdCltSSlwKzmDFARiFbxpMX roYZhrbFZPwCnH+YIDcrmlNv2/P2KB3uedb28TyWkruxxYcA0Q1WSTYI4p6fuQr+G8WWl4m wiD8C2ren7CMMLl/vSCeQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:9p1MTuBuyDk=:YXzyCRUwn7APpAve3hKlPe nHF/oYpPvH043PpJDzBpYbX2thxZmSSswnsnQpSbKxZE0R21NYvE9cirR5tNGpYsMPnG7Bmqf NEJC8eMuHqYBXCdLHZaYKx4R+OcBtChRxmBPINgjkDR1Ukgntc1i1KRu2vK7It9BjLl9hTxE3 VW3wpunjSw68XQygDWLce0WU5vqFUynqGlJoQU/ZWFmrLgfkcQ/VkReLIPd6ftdq/F/2GXDwH QJyQKqHBt8OV+QmK9Hf9nWZNKA5/hqg/HXgaaFuYtm8xOiyxOPzYrdc84CmTQv5orBgkpMDq2 Rr7+PRFtp4CpCfi5obaWPlYtNxM5HKOPiPsv73te1dzJ1rUXKahVqHWVvvfD83y/c7+u4VDS9 5c091tcVi4cTXpP5grNjAI5gI32I9XsT4rs5/NwyIocG855f58pbttER2oGEG08eNP0+/kEeE 0YYB4yBmdBwCD+9fUMV4BPOLb9EbfqVgXVcacGY0GxgkcJqyFzAq2xpZQAyWVKfKiSxhTGnO5 uUCIJ/XQ8CjIxPLLJRwY0lDEIhwFNwyTm3CRoC+iCykFcwHxHcltBSItZud14OzT4E0YYUPFl 25wylPZDPavUJfd3p6KLltj+UyklBcFquHz5rDz/UyaDjrdeHEdDZwPH7lLD8P7AYmtrKBhA5 2qiLUdYwCVy54dXnj8DB1vY+tMlW7Sx1UVpyEFBTCFalY0iDP2tJOw6N7eRtmRNjFEuG8rK3E yZDWdccDiFt4fe8agM+/UPXd9XeUaSmH7WyzIg== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The lpfc_debug_dump_all_queues() function repeatedly calls into lpfc_debug_dump_qe(), which has a temporary 128 byte buffer. This was fine before the introduction of CONFIG_GCC_PLUGIN_STRUCTLEAK_VERBOSE because each instance could occupy the same stack slot. However, now they each get their own copy, which leads to a huge increase in stack usage as seen from the compiler warning: drivers/scsi/lpfc/lpfc_debugfs.c: In function 'lpfc_debug_dump_all_queues': drivers/scsi/lpfc/lpfc_debugfs.c:6474:1: error: the frame size of 1712 bytes is larger than 100 bytes [-Werror=frame-larger-than=] Avoid this by not marking lpfc_debug_dump_qe() as inline so the compiler can choose to emit a static version of this function when it's needed or otherwise silently drop it. As an added benefit, not inlining multiple copies of this function means we save several kilobytes of .text section, reducing the file size from 47kb to 43. It is somewhat unusual to have a function that is static but not inline in a header file, but this does not cause problems here because it is only used by other inline functions. It would however seem reasonable to move all the lpfc_debug_dump_* functions into lpfc_debugfs.c and not mark them inline as a later cleanup. Fixes: 81a56f6dcd20 ("gcc-plugins: structleak: Generalize to all variable types") Signed-off-by: Arnd Bergmann --- drivers/scsi/lpfc/lpfc_debugfs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/lpfc/lpfc_debugfs.h b/drivers/scsi/lpfc/lpfc_debugfs.h index 2322ddb085c0..34070874616d 100644 --- a/drivers/scsi/lpfc/lpfc_debugfs.h +++ b/drivers/scsi/lpfc/lpfc_debugfs.h @@ -330,7 +330,7 @@ enum { * This function dumps an entry indexed by @idx from a queue specified by the * queue descriptor @q. **/ -static inline void +static void lpfc_debug_dump_qe(struct lpfc_queue *q, uint32_t idx) { char line_buf[LPFC_LBUF_SZ]; -- 2.20.0