From: Michal Kubecek <mkubecek@suse.cz>
To: David Miller <davem@davemloft.net>
Cc: mk.singh@oracle.com, netdev@vger.kernel.org,
eric.dumazet@gmail.com, j.vosburgh@gmail.com, vfalico@gmail.com,
andy@greyhouse.net, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] bonding:avoid repeated display of same link status change
Date: Sun, 4 Nov 2018 20:41:21 +0100 [thread overview]
Message-ID: <20181104194121.GA29914@unicorn.suse.cz> (raw)
In-Reply-To: <20181102.233138.738200505012734856.davem@davemloft.net>
On Fri, Nov 02, 2018 at 11:31:38PM -0700, David Miller wrote:
> From: mk.singh@oracle.com
> 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.
Part of the misunderstanding is caused by the fact that this is actually
a v4 but not marked as such:
v1: https://patchwork.ozlabs.org/patch/955789/
v2: https://patchwork.ozlabs.org/patch/970421/
v3: https://patchwork.ozlabs.org/patch/988241/
When commenting v3, I didn't know about the v2 discussion where Eric
Dumazet NACKed the patch because of potential conflict issues:
https://patchwork.ozlabs.org/patch/970421/#1992397
https://patchwork.ozlabs.org/patch/988241/#2017317
On the other hand, there is no need for atomic64_t. Simple atomic_t
(with explaining comment) would suffice. On architectures allowing
atomic read/write for 32-bit integers, there would be no performance
penalty. On architectures not allowing it, atomic_read() and
atomic_set() are implemented to be safe.
Michal Kubecek
next prev parent reply other threads:[~2018-11-04 19:41 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-31 10:57 [PATCH] bonding:avoid repeated display of same link status change mk.singh
2018-11-03 6:31 ` David Miller
2018-11-04 19:41 ` Michal Kubecek [this message]
2018-11-20 10:41 ` Manish Kumar Singh
-- strict thread matches above, loose matches on Subject: below --
2018-10-23 15:29 mk.singh
2018-10-23 15:54 ` Mahesh Bandewar (महेश बंडेवार)
2018-10-23 16:10 ` Eric Dumazet
2018-10-23 16:26 ` Michal Kubecek
2018-10-23 16:38 ` Michal Kubecek
2018-10-25 9:21 ` Manish Kumar Singh
2018-10-25 9:29 ` Michal Kubecek
2018-10-26 6:49 ` Manish Kumar Singh
2018-10-23 18:08 ` David Miller
2018-09-17 7:20 [PATCH] bonding: avoid " mk.singh
2018-09-17 14:38 ` Eric Dumazet
2018-09-18 5:05 ` Manish Kumar Singh
2018-09-18 14:00 ` Eric Dumazet
2018-09-24 7:05 ` Manish Kumar Singh
2018-10-22 7:29 ` Manish Kumar Singh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181104194121.GA29914@unicorn.suse.cz \
--to=mkubecek@suse.cz \
--cc=andy@greyhouse.net \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=j.vosburgh@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mk.singh@oracle.com \
--cc=netdev@vger.kernel.org \
--cc=vfalico@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).