All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Baron <jbaron@akamai.com>
To: eric.dumazet@gmail.com, davem@davemloft.net
Cc: netdev@vger.kernel.org
Subject: [PATCH v2 net-next 1/2] tcp: replace smp_mb__after_atomic() with smp_mb() in tcp_poll()
Date: Wed, 22 Jun 2016 11:32:50 -0400	[thread overview]
Message-ID: <ac8b2dae8215afe2027e1a581f712a435bd91d06.1466608332.git.jbaron@akamai.com> (raw)
In-Reply-To: <cover.1466608332.git.jbaron@akamai.com>
In-Reply-To: <cover.1466608332.git.jbaron@akamai.com>

From: Jason Baron <jbaron@akamai.com>

sock_reset_flag() maps to __clear_bit() not the atomic version clear_bit(),
hence we need an smp_mb() there, smp_mb__after_atomic() is not sufficient.

Fixes: 3c7151275c0c ("tcp: add memory barriers to write space paths")
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Jason Baron <jbaron@akamai.com>
---
 net/ipv4/tcp_input.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 94d4aff97523..3ba526ecdeb9 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -4987,7 +4987,7 @@ static void tcp_check_space(struct sock *sk)
 	if (sock_flag(sk, SOCK_QUEUE_SHRUNK)) {
 		sock_reset_flag(sk, SOCK_QUEUE_SHRUNK);
 		/* pairs with tcp_poll() */
-		smp_mb__after_atomic();
+		smp_mb();
 		if (sk->sk_socket &&
 		    test_bit(SOCK_NOSPACE, &sk->sk_socket->flags))
 			tcp_new_space(sk);
-- 
2.6.1

  reply	other threads:[~2016-06-22 15:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-22 15:32 [PATCH v2 net-next 0/2] tcp: reduce cpu usage when SO_SNDBUF is set Jason Baron
2016-06-22 15:32 ` Jason Baron [this message]
2016-06-22 15:32 ` [PATCH v2 net-next 2/2] " Jason Baron
2016-06-22 17:34   ` Eric Dumazet
2016-06-22 18:18     ` Jason Baron
2016-06-22 18:43       ` Eric Dumazet
2016-06-22 18:51         ` Eric Dumazet
2016-06-22 19:20           ` Jason Baron
2016-06-22 20:15             ` 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=ac8b2dae8215afe2027e1a581f712a435bd91d06.1466608332.git.jbaron@akamai.com \
    --to=jbaron@akamai.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.