From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH] bonding:avoid repeated display of same link status change Date: Tue, 23 Oct 2018 11:08:02 -0700 (PDT) Message-ID: <20181023.110802.2298971732908535065.davem@davemloft.net> References: <20181023152924.24033-1-mk.singh@oracle.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, j.vosburgh@gmail.com, vfalico@gmail.com, andy@greyhouse.net, linux-kernel@vger.kernel.org To: mk.singh@oracle.com Return-path: In-Reply-To: <20181023152924.24033-1-mk.singh@oracle.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org From: mk.singh@oracle.com Date: Tue, 23 Oct 2018 20:59:24 +0530 > @@ -229,6 +229,7 @@ struct bonding { > struct dentry *debug_dir; > #endif /* CONFIG_DEBUG_FS */ > struct rtnl_link_stats64 bond_stats; > + atomic_t rtnl_needed; As mentioned by others, if the only operations you perform on a value are set and read, using atomic_t is utterly and totally pointless. I really have no idea what is achieved by using atomic_t in this set of circumstances. It is not guaranteeing that the value stays stable after you read it, and it is not guaranteeing that another thread won't overwrite the value you just set it to. All of those things, if important, need proper synchronization. An atomic_t by itself will not do that for you.