From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [RFC net-next 2/2] net: net-sysfs: Reduce netstat_show read_lock critical section Date: Tue, 10 Apr 2018 13:17:26 -0400 (EDT) Message-ID: <20180410.131726.489974712859296224.davem@davemloft.net> References: <20180410170812.18905-1-saeedm@mellanox.com> <20180410170812.18905-2-saeedm@mellanox.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org To: saeedm@mellanox.com Return-path: Received: from shards.monkeyblade.net ([184.105.139.130]:56636 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751790AbeDJRR2 (ORCPT ); Tue, 10 Apr 2018 13:17:28 -0400 In-Reply-To: <20180410170812.18905-2-saeedm@mellanox.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Saeed Mahameed Date: Tue, 10 Apr 2018 10:08:12 -0700 > Instead of holding the device chain read_lock also while calling > dev_get_stats just hold it only to check dev_isalive, if the dev is alive, > hold that dev via dev_hold then release the read_lock. > > When done handling the device, dev_put it. > > Signed-off-by: Saeed Mahameed My feedback here is that same as for patch #1. Two atomics for a shorter RCU lock hold time is not that great of a tradeoff.