Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2358609imd; Fri, 2 Nov 2018 10:01:16 -0700 (PDT) X-Google-Smtp-Source: AJdET5e4Nnm+Lp232KsfWETvW/2mLSa1SpR0MoPvv+yXOlyuR3zbBd3vWYPcgwCXgARAe6XIRGQg X-Received: by 2002:a17:902:3103:: with SMTP id w3-v6mr12687504plb.51.1541178076736; Fri, 02 Nov 2018 10:01:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541178076; cv=none; d=google.com; s=arc-20160816; b=XejZ4V6CF0HRHr08v6hdAYETNLYtrTYWSTN4qkUa+9PM1Vl9f5mto1t3AOkI7upkog AZTKB7ZiBgKdkFUDRbc8meJ9LpWEFS3HpmV/oxyfzxStSOIwlJwfi8lO5yRcZzmmNvcz sKC8Jp7P9f2wR8hMuEMOMiWZtc7EwUslSFHTQWWZKRB2EEyiL+tgtevmRg7iJTsE5ciV NBq5o00s2GsMvG3Scrp+induVovGj5JCih9dOOId1xVLXv3q/JjWxJarJa9bx9sBTT2n JMfaIe4JqJRDTeK2oy8A+J4lYLbTXuGo5AqRwWDpAne9TwPGkqVTZ7xaKd4pm1ZDPz+O /biA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=+epNv53pBINpVve9YuiRRQBJKb3zG0Ihe3qeNCWLiwY=; b=RI/7jl43iF5gWBLfoVv6kq/tJaHMGENJgE3Yu4MM4UWqioa3nl+KJ6aNiuYz0CgZDO 9/5QrdDUA4e5SGgDAFcdiTC7oGsrdRyzkqaL9BIHz16n0D28BieUApAMhflb5qqcmkFM v5oPJfFHBFsmy5byBXS8+UgMP6ZkB1kToCCzOsPqzm0nOnxXLzK6d7SqpBTDIGWj0Kzk ekhcxncIVTfXA38j2dXmTe6mRpHmjTbWisZQi2y19JTbqpxiJ282upDcOgOdZupfECdU Bo1K/sJ6AOuAvCxLpCR7mE6aC6q8JppTcl7iZstaXKJc0qGlq5WZWURJIOE1P7l/mF90 pzwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=cLvTly4P; 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 20-v6si34650003pfk.287.2018.11.02.10.01.00; Fri, 02 Nov 2018 10:01:16 -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=@ziepe.ca header.s=google header.b=cLvTly4P; 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 S1728102AbeKCCIL (ORCPT + 99 others); Fri, 2 Nov 2018 22:08:11 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:36160 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726799AbeKCCIL (ORCPT ); Fri, 2 Nov 2018 22:08:11 -0400 Received: by mail-pl1-f193.google.com with SMTP id w24-v6so1290381plq.3 for ; Fri, 02 Nov 2018 10:00:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=+epNv53pBINpVve9YuiRRQBJKb3zG0Ihe3qeNCWLiwY=; b=cLvTly4Pzq4gvAaXz3oUuxHu2sAPp0I5CYovBrg2ljvLjfTz0w1xCSxJIRfDKygxpm EBCdwZZYm9YyjH8w+Oi0Sw85y9sC3Rnmp4h92M0ueWthmT6u463sS/FzTueWs1DO7Xj6 O5rhfSkIE/3LbNGAg8e/io4nFE6KN4aDwvNrOaG1QJ1aO+SyHVxvvaq3Ka+zmjJiicjx nGBitjBNz4XcItincdL7oLWxIPGk324krxMZtqanyKDDKc8ssDQePjx+P+2b+QKPj9gk uVkblpJ7NjcqLKhMrR0MUvpbCb9tqXZmxkWPTpo+1YlzFgxq5zO6VmTW7F4kWT4p/1Yl /c+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=+epNv53pBINpVve9YuiRRQBJKb3zG0Ihe3qeNCWLiwY=; b=EX1EAyKPbQ15d5PszTnxjGSCJQSfig6lhzosL0tL3ZSCuAjp0LmfKjtNkOci8zXLCZ Hb/xMGFINJAfVEVyQgDJM21LepzYU7vJsvaLRIwvyHmJUxhxPqevYGs3XZFoe1XGSrEx 1VxXm7+LHE2sYZ3JXyj3b8RtGfvT69K760IsEnwQSj++N86t6RIRYNkW1yHb8/1B38pp CqByqCL+7S/t//4aeLGEnIy395t8rkDVS5FjVRT7adu9jkKnwYmlqMy/x6p10te8j52h gjIPJ2evjDnWA9Lq8TyaMDMo0O0tL53ZHVuNjpIDhNbGk2i62xb6dNlXaxODQ2gbe+i4 X1zw== X-Gm-Message-State: AGRZ1gLuSeNRDqXFtjjagqS2Ln/S/0I6f+Hpcxb7AJVXFhukImWT7LLh g1cYpCN1A7v1Bo4RcFEQ6b/97Q== X-Received: by 2002:a17:902:6901:: with SMTP id j1-v6mr12525180plk.26.1541178022927; Fri, 02 Nov 2018 10:00:22 -0700 (PDT) Received: from ziepe.ca (S010614cc2056d97f.ed.shawcable.net. [174.3.196.123]) by smtp.gmail.com with ESMTPSA id b62-v6sm36509767pfa.159.2018.11.02.10.00.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 02 Nov 2018 10:00:21 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1gIco0-0005qb-O9; Fri, 02 Nov 2018 11:00:20 -0600 Date: Fri, 2 Nov 2018 11:00:20 -0600 From: Jason Gunthorpe To: Arnd Bergmann Cc: Saeed Mahameed , Leon Romanovsky , "David S. Miller" , Tariq Toukan , Eran Ben Elisha , Boris Pismenny , Ilya Lesokhin , Moshe Shemesh , Kamal Heib , netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net/mlx5e: fix high stack usage Message-ID: <20181102170020.GB17096@ziepe.ca> References: <20181102153316.1492515-1-arnd@arndb.de> <20181102160858.GA17096@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 02, 2018 at 05:23:26PM +0100, Arnd Bergmann wrote: > On 11/2/18, Jason Gunthorpe wrote: > > On Fri, Nov 02, 2018 at 04:33:03PM +0100, Arnd Bergmann wrote: > >> A patch that looks harmless causes the stack usage of the > >> mlx5e_grp_sw_update_stats() > >> function to drastically increase with x86 gcc-4.9 and higher (tested up to > >> 8.1): > >> > >> drivers/net/ethernet/mellanox/mlx5/core/en_stats.c: In function > >> ‘mlx5e_grp_sw_update_stats’: > >> drivers/net/ethernet/mellanox/mlx5/core/en_stats.c:216:1: warning: the > >> frame size of 1276 bytes is larger than 500 bytes [-Wframe-larger-than=] > > > > Why is the stack size so big here? The mlx5e_sw_stats is < 500 bytes > > and all the other on-stack stuff looks pretty small? > > I am not entirely sure, but my analysis indicates that gcc tries loop unrolling > or some other optimization that leads to two copies on the stack. Wow how strange Did you consier adding a __attribute__((optimize("no-unroll-loops"))) type macro? Jason