From mboxrd@z Thu Jan 1 00:00:00 1970 From: James Smart Subject: Re: [PATCH 2/4] lpfc: reduce stack size with CONFIG_GCC_PLUGIN_STRUCTLEAK_VERBOSE Date: Fri, 28 Jun 2019 11:57:22 -0700 Message-ID: <3027eebb-e49f-6db6-ae0a-39a61c0e34e1@broadcom.com> References: <20190628123819.2785504-1-arnd@arndb.de> <20190628123819.2785504-2-arnd@arndb.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20190628123819.2785504-2-arnd@arndb.de> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org To: Arnd Bergmann , Kees Cook , 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 , Hannes Reinecke , Willy Tarreau , Silvio Cesare List-Id: linux-scsi@vger.kernel.org On 6/28/2019 5:37 AM, Arnd Bergmann wrote: > 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. I agree with this 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(-) > > Reviewed-by: James Smart -- james