[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20181023.110802.2298971732908535065.davem@davemloft.net>
Date: Tue, 23 Oct 2018 11:08:02 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: mk.singh@...cle.com
Cc: netdev@...r.kernel.org, j.vosburgh@...il.com, vfalico@...il.com,
andy@...yhouse.net, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] bonding:avoid repeated display of same link status
change
From: mk.singh@...cle.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.
Powered by blists - more mailing lists