Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2615846imd; Fri, 2 Nov 2018 14:39:49 -0700 (PDT) X-Google-Smtp-Source: AJdET5fsVWxqZCc98Wf3B+pFYHBkBNd/I1P3q4AFCzXfNWk6FHCTGkw4SGxJVfa5I2MC2RDVUZEW X-Received: by 2002:a17:902:162:: with SMTP id 89-v6mr13170165plb.293.1541194789843; Fri, 02 Nov 2018 14:39:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541194789; cv=none; d=google.com; s=arc-20160816; b=YGwOhQ6f/Un3E4T0CPS8HPlwCugRPh8fbGeIJTUSV+/1oWHPutWXJUXVxG2k0+XNhw opCmivcNSRppLDr4dXZ1j5fsPTYw1sLLL6wKTvLWgIVXn5x15FJ4rMHKPQdJNGa5YiWC 5qS57tCNzEhxB8X3qbDE2Ex+wbwVXKDUkXSy8GGB6MoK5HGjciOg3p9kOXQriRk9bB4G MCjdNyEHcrqXunIKOmnWFGvdVOtFuesE9M2qColvLiipCd4ugNqSFuVWXg8K21y03IH5 Gl36XTN+XrBMsFrq0Pe30/9OcXg6I5B2oVWLB6e+8UMZdFD4jhPGvyRhb7wWfTp2VIhB rgbw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=7gGFypwaejshENOyGBcvndgUcwhC1mGFoYuO6DLqYCQ=; b=Wbrj30A/b/etBheqhqUP2nJ12gQbxuZgOBXl/6pyPhmiZfIWHDpCIjJpuN4Jxry6MX EPpj/qCMocAi6RWC4+26nr4jgP2Mvx9R3TcJZNr3oqU+dwL08Foj7SYaQ/j9lpfMKBDk XQZg3GOuSlWp3/WCVl+Wap7mvfaWk5v5Ea5RVPApClff6Gbv3nQwbK5jrz0igW/v4XXx qDzH9FVTUzyS/Q24ypeCruB+w77larwg4iL2wWECueN/taoTUWCGUNU2Rcn0AWI9hLeP ux1/EDuOHzKx58SQRZA6Zkp3fgbi4bDyYc3xIpeJUSe8HUsaqLBFtku+ufvZF+IJneTv +tOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=O7RvnxNx; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a185si12974529pge.404.2018.11.02.14.39.34; Fri, 02 Nov 2018 14:39: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=@gmail.com header.s=20161025 header.b=O7RvnxNx; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727094AbeKCGsD (ORCPT + 99 others); Sat, 3 Nov 2018 02:48:03 -0400 Received: from mail-pg1-f177.google.com ([209.85.215.177]:34069 "EHLO mail-pg1-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726100AbeKCGsD (ORCPT ); Sat, 3 Nov 2018 02:48:03 -0400 Received: by mail-pg1-f177.google.com with SMTP id k1-v6so1526657pgq.1; Fri, 02 Nov 2018 14:39:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=7gGFypwaejshENOyGBcvndgUcwhC1mGFoYuO6DLqYCQ=; b=O7RvnxNxDyPBTi29HDIx2K1rZ6n+yTYADNVazeUtuQ39ANAmqrozIs1QzS26wSroNG FeSXoz0xWdJfPkh0C8tYhUuz1fqOcrkxdzSj8CPpp3tedkawrkZwnRsIrwye53V1+sRA HdbJzAvqsfB/ChPJFZ+Vd7gcXNZ+WkJR8kGPdcyLM1cS68UvjI2AslD4TiFL+ly8Zb9c lLeRi/Ft+bVUsyEBTrV34nDiF4KZoQmCUKsJozbC7GojAEivaPkAdP5OpyBhnmqJ+kl1 FKO1R1pAowK8FsXdSVmhl34wrl0AnQd8zU6/xellFPJtEWS+p330rr0J1hMx7WVwEY4D q8hQ== 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-language :content-transfer-encoding; bh=7gGFypwaejshENOyGBcvndgUcwhC1mGFoYuO6DLqYCQ=; b=Ap1VTGJZw+KGbekYaUHY7iWQf4V0BrmMlkDdqGzBfkVHPrbXlF8MzbRvAF+xTzoNeS jgF8APMOHZTrusp86txtAbQ/GFgOMwr5BjeRxkuz81pnQK1aAZmG5zf6NR66Rle1UBKS 6qHlL37bJZpagHJMLosqx5ibsbuQOufaog2OlWmL2cxnWuchrK5iRMWmtR9f2ubg+Bgd Urx6wFM0xRELdSr23kwhE0aITXvAVFVES9w3E0+9y7wMmx67Djk0BsqjlOOxxu/kNhjK UcG/nBYlkyAgl2wTjs3VntvlRNdp4dV94ZEGRziGaVoAUDJLsb12M1aAw/kEbhQ3FG73 13QA== X-Gm-Message-State: AGRZ1gLuz1h3jH0WAHCmrCmmt5QzKVd9hSB8W05jasw5WxLcT475p+6f hzfIJnnkhbhAj/sL9wCWFerE88+o X-Received: by 2002:a63:561b:: with SMTP id k27mr12399465pgb.271.1541194754309; Fri, 02 Nov 2018 14:39:14 -0700 (PDT) Received: from [192.168.86.235] (c-67-180-167-114.hsd1.ca.comcast.net. [67.180.167.114]) by smtp.gmail.com with ESMTPSA id k13-v6sm35738194pff.30.2018.11.02.14.39.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Nov 2018 14:39:13 -0700 (PDT) Subject: Re: [PATCH] net/mlx5e: fix high stack usage To: Saeed Mahameed , "davem@davemloft.net" , "arnd@arndb.de" , "leon@kernel.org" Cc: "linux-kernel@vger.kernel.org" , Moshe Shemesh , "linux-rdma@vger.kernel.org" , Boris Pismenny , Tariq Toukan , "akpm@linux-foundation.org" , Eran Ben Elisha , "netdev@vger.kernel.org" , Ilya Lesokhin , Kamal Heib References: <20181102153316.1492515-1-arnd@arndb.de> <9f214f12ec89020ceb14c1aec25b3a0d968507aa.camel@mellanox.com> From: Eric Dumazet Message-ID: <2727f37b-1742-5532-317e-3be8a984266b@gmail.com> Date: Fri, 2 Nov 2018 14:39:11 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <9f214f12ec89020ceb14c1aec25b3a0d968507aa.camel@mellanox.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/02/2018 02:05 PM, Saeed Mahameed wrote: > temp will be mem copied to priv->stats.sw at the end, > memcpy(&priv->stats.sw, &s, sizeof(s)); > > one other way to solve this as suggested by Andrew, is to get rid of > the temp var and make it point directly to priv->stats.sw > What about concurrency ? This temp variable is there to make sure concurrent readers of stats might not see mangle data (because another 'reader' just did a memset() and is doing the folding) mlx5e_get_stats() can definitely be run at the same time by multiple threads.