From: Eric Dumazet <edumazet@google.com>
To: Wei Wang <weiwan@google.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
"David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, netdev <netdev@vger.kernel.org>,
Arjun Roy <arjunroy@google.com>
Subject: Re: [PATCH net-next 2/2] tcp: factorize logic into tcp_epollin_ready()
Date: Sat, 13 Feb 2021 09:04:55 +0100 [thread overview]
Message-ID: <CANn89iK7U69XKZVFS2PXUSZhck5xaRE-hkxVe7Q1pbaE8m1cZw@mail.gmail.com> (raw)
In-Reply-To: <CANn89iJ-Y9avDrs3Jbx93J8zwMFfrY8Pq1LAL6tYWDvtcfdWKg@mail.gmail.com>
On Sat, Feb 13, 2021 at 8:50 AM Eric Dumazet <edumazet@google.com> wrote:
>
> On Sat, Feb 13, 2021 at 1:30 AM Wei Wang <weiwan@google.com> wrote:
> >
>
> > > void tcp_data_ready(struct sock *sk)
> > > {
> > > - const struct tcp_sock *tp = tcp_sk(sk);
> > > - int avail = tp->rcv_nxt - tp->copied_seq;
> > > -
> > > - if (avail < sk->sk_rcvlowat && !tcp_rmem_pressure(sk) &&
> > > - !sock_flag(sk, SOCK_DONE) &&
> >
> > Seems "!sock_flag(sk, SOCK_DONE)" is not checked in
> > tcp_epollin_read(). Does it matter?
> >
>
>
> Yes, probably, good catch.
>
> Not sure where tcp_poll() gets this, I have to double check.
It gets the info from sk->sk_hutdown & RCV_SHUTDOWN
tcp_find() sets both sk->sk_shutdown |= RCV_SHUTDOWN and
sock_set_flag(sk, SOCK_DONE);
This seems to suggest tcp_fin() could call sk->sk_data_ready() so that
we do not have to test for this unlikely condition in tcp_data_ready()
next prev parent reply other threads:[~2021-02-13 8:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-12 23:22 [PATCH net-next 0/2] tcp: mem pressure vs SO_RCVLOWAT Eric Dumazet
2021-02-12 23:22 ` [PATCH net-next 1/2] tcp: fix SO_RCVLOWAT related hangs under mem pressure Eric Dumazet
2021-02-13 0:23 ` Wei Wang
2021-02-12 23:22 ` [PATCH net-next 2/2] tcp: factorize logic into tcp_epollin_ready() Eric Dumazet
2021-02-13 0:30 ` Wei Wang
2021-02-13 7:50 ` Eric Dumazet
2021-02-13 8:04 ` Eric Dumazet [this message]
2021-02-13 17:10 ` Arjun Roy
2021-02-13 17:21 ` Arjun Roy
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=CANn89iK7U69XKZVFS2PXUSZhck5xaRE-hkxVe7Q1pbaE8m1cZw@mail.gmail.com \
--to=edumazet@google.com \
--cc=arjunroy@google.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=weiwan@google.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).