From: Eric Dumazet <eric.dumazet@gmail.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: Linux Netdev List <netdev@vger.kernel.org>
Subject: [PATCH] net: dst_release() cleanup
Date: Sat, 05 Dec 2009 13:02:13 +0100 [thread overview]
Message-ID: <4B1A4BC5.3050300@gmail.com> (raw)
atomic_dec_return() is a full memory barrier, we can omit
the smp_mb__before_atomic_dec() call.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
net/core/dst.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/net/core/dst.c b/net/core/dst.c
index 57bc4d5..cdec1d1 100644
--- a/net/core/dst.c
+++ b/net/core/dst.c
@@ -262,13 +262,8 @@ again:
void dst_release(struct dst_entry *dst)
{
- if (dst) {
- int newrefcnt;
-
- smp_mb__before_atomic_dec();
- newrefcnt = atomic_dec_return(&dst->__refcnt);
- WARN_ON(newrefcnt < 0);
- }
+ if (dst)
+ WARN_ON(atomic_dec_return(&dst->__refcnt) < 0);
}
EXPORT_SYMBOL(dst_release);
next reply other threads:[~2009-12-05 12:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-05 12:02 Eric Dumazet [this message]
2009-12-07 17:17 ` [PATCH] net: dst_release() cleanup Stephen Hemminger
2009-12-07 18:12 ` Eric Dumazet
2009-12-07 18:57 ` Stephen Hemminger
2009-12-07 18:59 ` Ilpo Järvinen
2009-12-07 19:13 ` Eric Dumazet
2009-12-09 4:35 ` David Miller
2009-12-09 21:46 ` Eric Dumazet
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=4B1A4BC5.3050300@gmail.com \
--to=eric.dumazet@gmail.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/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).