Re: [PATCH] bonding:avoid repeated display of same link status change

From: David Miller
Date: Sat Nov 03 2018 - 02:31:43 EST


From: mk.singh@xxxxxxxxxx
Date: Wed, 31 Oct 2018 16:27:28 +0530

> - if (slave->delay) {
> + if (slave->delay &&
> + !atomic64_read(&bond->rtnl_needed)) {
...
> + !atomic64_read(&bond->rtnl_needed)) {
...
> + atomic64_set(&bond->rtnl_needed, 1);
...
> + atomic64_set(&bond->rtnl_needed, 0);
...
> @@ -229,6 +229,7 @@ struct bonding {
> struct dentry *debug_dir;
> #endif /* CONFIG_DEBUG_FS */
> struct rtnl_link_stats64 bond_stats;
> + atomic64_t rtnl_needed;

There is nothing "atomic" about a value that is only set and read.

And using a full 64-bit value for something taking on only '0' and
'1' is unnecessary as well.