Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10676403ybi; Thu, 25 Jul 2019 03:28:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqwxIRhSrf0IS9thGfqzQmqPCfYMt9LTRih3T1SonA/w2VZusVuYXK4V6iSa6Qv3MrJjLQc7 X-Received: by 2002:a62:3543:: with SMTP id c64mr15571668pfa.242.1564050522294; Thu, 25 Jul 2019 03:28:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564050522; cv=none; d=google.com; s=arc-20160816; b=YMJPEKSeFvdu+XRf8v5QS6k0U+vCnEEpduesMMUyQiJuxiHApj5p4jvx+v+clr5RZR BMXmJ9KufQlMDGJQNf1/DDnbG00VvjQhMPut/E8YU9lZoyvtF5vMFMdK37r7yk+Nto5K nQJHBj7/Uvm4y+avKQfqkWuifekpjJ7TKpqbwVy94EJcxkyFqBQ+gZeNNg+f0CE2Cage W8XsuMM7qVWTRlZDSvD50temFjsQUw+YF9gcIKON4Sy1ULvNz2ioUWumgjjqACSGuCWA B09alAo0Meukw11RjCoasPdQ48uXZCPbk/hSP+x98398/axmPjIYv9kSF/gogjwMNvlL kr2g== 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:from:subject:cc:to:message-id:date; bh=0QPNQlel3sRar28P2lfaWWwZL7Ku00VF1onelK049J8=; b=zVUKMsiIiz4knpUGdEECR84rhsTBp6NLoffz+lcFbOj35rmpRrdDCgu+C2GVWDYZrQ BoGKkGpML50UTnROHfH6u0nSqmDrypBwiZ/Pcan1RiEgV0YMxR2QX6n2lZykOf3MW5in 7Z3fwkpB+eRD0jMEwzqXnxS0ob1WGacKe+VEK5zYWkfnmyr8ltbsYMehzrbZ2W/thHSn 6EegzQZh2poQOrpO/IboDp42QkhC8pWhrSEqZml14sH0v48YigYv1yOuEpJf5XNwDWGk ACB26d6VHg34YY1to8w3J4ZHxZ9AKouus9TPQbNKmeZVFcgjnwAFskSXavRTcyoJgwUe ABBA== 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 w12si17576991pgs.364.2019.07.25.03.28.23; Thu, 25 Jul 2019 03:28:42 -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 S1729561AbfGXWrH (ORCPT + 99 others); Wed, 24 Jul 2019 18:47:07 -0400 Received: from shards.monkeyblade.net ([23.128.96.9]:53120 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728048AbfGXWrH (ORCPT ); Wed, 24 Jul 2019 18:47:07 -0400 Received: from localhost (unknown [IPv6:2601:601:9f80:35cd::d71]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 18C311543C8D5; Wed, 24 Jul 2019 15:47:06 -0700 (PDT) Date: Wed, 24 Jul 2019 15:47:05 -0700 (PDT) Message-Id: <20190724.154705.141831380224703229.davem@davemloft.net> To: arnd@arndb.de Cc: tariqt@mellanox.com, ereza@mellanox.com, jackm@dev.mellanox.co.il, eli@mellanox.co.il, moshe@mellanox.com, jiri@mellanox.com, netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com Subject: Re: [PATCH net-next] [net-next] mlx4: avoid large stack usage in mlx4_init_hca() From: David Miller In-Reply-To: <20190722150204.1157315-1-arnd@arndb.de> References: <20190722150204.1157315-1-arnd@arndb.de> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Wed, 24 Jul 2019 15:47:06 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann Date: Mon, 22 Jul 2019 17:01:55 +0200 > The mlx4_dev_cap and mlx4_init_hca_param are really too large > to be put on the kernel stack, as shown by this clang warning: > > drivers/net/ethernet/mellanox/mlx4/main.c:3304:12: error: stack frame size of 1088 bytes in function 'mlx4_load_one' [-Werror,-Wframe-larger-than=] > > With gcc, the problem is the same, but it does not warn because > it does not inline this function, and therefore stays just below > the warning limit, while clang is just above it. > > Use kzalloc for dynamic allocation instead of putting them > on stack. This gets the combined stack frame down to 424 bytes. > > Signed-off-by: Arnd Bergmann Applied.