Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp3625379ybd; Fri, 28 Jun 2019 11:57:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqyFDCwthFPz/0hSN+1sVOjjz87AyeTbrTQjnukl0HwGoft1u8ALwULt/r2uT5vLYpnK8Fmd X-Received: by 2002:a17:902:26c:: with SMTP id 99mr13878610plc.215.1561748269737; Fri, 28 Jun 2019 11:57:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561748269; cv=none; d=google.com; s=arc-20160816; b=ZHJrg8aW0yBjfEmYIIE0g9FdR3JjtZSb6UiUqkX47UIHW6krLEHZCbgJO6pULFBtPL nZlKt+Uysjhv/HzbMvIgw5vUjECDoGFgvPpKel/viRdKC7wEGxvbXEyWSj/LAJyiSMkG ZnFHUZYcgGDCGDPXvb/oX4TfL+1ZQFSqPKLVLGkQH9kcmSyUEe2rlv6MxVCSuxq1m7yL d9f7j14HXAVNYHo8dcqs8vjwTPLc+lT/LEajFNZ5pv+p4Hk1Dwwo9kgd66zN9tDeJP6G e3oo7Qus8cJSsWYEOa/1rBIQGhYDw3+DO60SqIfuhN9KNUrYLE9ezS3zcNk3ub6RTPEG V6qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=GEJr3AqvHre2EqiUp9wkeTIrlXFQndtx5Gxgp/CLC/Y=; b=x5caM+txP9xcQh3HqHNou6zD7jU7tgou+pnq9gVv1gFrrLl7iPNuK1UEoihPFpiXaC 7n/HLZv2ou+C7XmMqMir0WwbKLSWn3esxpBscYFf2HAVBGTCDZwKaOjsV9kFsWoivvR2 mL+8M2b9qN/4gGNqii+MUjOB6VgRBW1tWZc57em6goAHbabdyp1I0/5xTIh485vXoBB4 L3HR941T01FOrb5ZXpO8szHZ+cxummhY0RzKygfnQbaPD02rcWMZt8ptwhz1lUmv4vpV VImhT74aC3KHNR9ejT5CT7L8KVzyQQTLDBIcrdhLEuJPjRj6+BRj3TlcVyD41AUfczSf yMTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=XoArU2Aw; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q26si2596313pgl.114.2019.06.28.11.57.33; Fri, 28 Jun 2019 11:57:49 -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; dkim=pass header.i=@broadcom.com header.s=google header.b=XoArU2Aw; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726835AbfF1S51 (ORCPT + 99 others); Fri, 28 Jun 2019 14:57:27 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:43043 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726875AbfF1S50 (ORCPT ); Fri, 28 Jun 2019 14:57:26 -0400 Received: by mail-pl1-f193.google.com with SMTP id cl9so3721760plb.10 for ; Fri, 28 Jun 2019 11:57:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=GEJr3AqvHre2EqiUp9wkeTIrlXFQndtx5Gxgp/CLC/Y=; b=XoArU2Aw8uy6yHzMzOQ8pchviB6L+RP4fgA/8H3T5PNGYyVaXqKQqTIwc7a4oy+fnV F1iR3tXMQ34FbQ+fE8PXhJfHqbNf+Sn8tcEf7KYCanV+dVUAQA5PC6ql/3/lkLjzI4Cv BT9bbsuFZ5wsJLWle1D+GKJmmk4aHobb+e2eY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=GEJr3AqvHre2EqiUp9wkeTIrlXFQndtx5Gxgp/CLC/Y=; b=op7cR912CZax/K4nkfDS23RhF1c4AMNVUP8fkY3PpcIfC0bhBqTrB7Ddym+JHWy2eL 4/9nnmgrCn5EueLBK7F1y+jxyJ7ZbJ/AeCGC+94UY6Uns49QLVag3MGaNzg0Qt63L+nO DGeOUlsrHebi1IWLRYTN/c1x1hvOTMJCj51zXdbaFF71j9WaJZ69K4kvKKJ9Bm+ufGjw q+DwlRaJECe7OVHrSrk9i4oqs1XA64Tyd/xC1A76EmCiwo9jkY1SN23GgNUtRqj3Q5zy EQSAaR/NXqk9nwBV5wIjKcDYNlYFQi1j/A+yOFgfzKZmWNPJ9SPCyARRjDYJEwhvUqaT zfPg== X-Gm-Message-State: APjAAAWTQWDZRFKgCuz9c6ayLKXeQ7pd3LtxBfQJ0etC2c7vJVKIWT37 3jxjP/dwzNQPiyN9KYGqUn1jZQ== X-Received: by 2002:a17:902:aa03:: with SMTP id be3mr13363364plb.240.1561748246107; Fri, 28 Jun 2019 11:57:26 -0700 (PDT) Received: from [10.230.29.90] ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id b15sm3008737pfi.141.2019.06.28.11.57.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Jun 2019 11:57:25 -0700 (PDT) Subject: Re: [PATCH 2/4] lpfc: reduce stack size with CONFIG_GCC_PLUGIN_STRUCTLEAK_VERBOSE 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 References: <20190628123819.2785504-1-arnd@arndb.de> <20190628123819.2785504-2-arnd@arndb.de> From: James Smart Message-ID: <3027eebb-e49f-6db6-ae0a-39a61c0e34e1@broadcom.com> Date: Fri, 28 Jun 2019 11:57:22 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <20190628123819.2785504-2-arnd@arndb.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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