From: Herbert Xu <herbert@gondor.apana.org.au>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Jason Baron <jbaron@akamai.com>,
davem@davemloft.net, netdev@vger.kernel.org, oleg@redhat.com
Subject: Re: [PATCH net] tcp: correct memory barrier usage in tcp_check_space()
Date: Sat, 4 Feb 2017 23:57:25 +0800 [thread overview]
Message-ID: <20170204155725.GA6244@gondor.apana.org.au> (raw)
In-Reply-To: <1486221577.21871.126.camel@edumazet-glaptop3.roam.corp.google.com>
On Sat, Feb 04, 2017 at 07:19:37AM -0800, Eric Dumazet wrote:
>
> > The comment says that it's pairing with an mb in tcp_poll, but
> > tcp_poll doesn't touch QUEUE_SHRUNK at all. So what exactly is
> > this barrier for?
>
> Do not focus on QUEUE_SHRUNK flag, which is locally used by this thread
> only.
>
> The confusion comes because 3c7151275c0c9a80c3375f9874b1c7129a105eea
> thought it could avoid the cost of smp_mb() by abusing the fact that
> sock_reset_flag(sk, SOCK_QUEUE_SHRUNK) was doing an atomic,
> but it was not.
Thanks for the explanation. I see what it's protecting now. And
this could indeed be responsible for the race that Oleg reported.
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
prev parent reply other threads:[~2017-02-04 15:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-25 2:49 [PATCH net] tcp: correct memory barrier usage in tcp_check_space() Jason Baron
2017-01-25 4:53 ` Eric Dumazet
2017-01-25 18:23 ` David Miller
2017-02-04 9:59 ` Herbert Xu
2017-02-04 15:19 ` Eric Dumazet
2017-02-04 15:57 ` Herbert Xu [this message]
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=20170204155725.GA6244@gondor.apana.org.au \
--to=herbert@gondor.apana.org.au \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=jbaron@akamai.com \
--cc=netdev@vger.kernel.org \
--cc=oleg@redhat.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