Skip to content

Commit 508b5ff

Browse files
Paolo Abeniintel-lab-lkp
authored andcommitted
mptcp: fix spurious wake-up on under memory pressure.
The wake-up condition currently implemented by mptcp_epollin_ready() is wrong, as it could mark the MPTCP socket as readable even when no data are present and the system is under memory pressure. Explicitly check for some data being available in the receive queue. Fixes: 5684ab1 ("mptcp: give rcvlowat some love") Signed-off-by: Paolo Abeni <[email protected]>
1 parent eb21976 commit 508b5ff

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

net/mptcp/protocol.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -757,10 +757,15 @@ static inline u64 mptcp_data_avail(const struct mptcp_sock *msk)
757757

758758
static inline bool mptcp_epollin_ready(const struct sock *sk)
759759
{
760+
u64 data_avail = mptcp_data_avail(mptcp_sk(sk));
761+
762+
if (!data_avail)
763+
return false;
764+
760765
/* mptcp doesn't have to deal with small skbs in the receive queue,
761-
* at it can always coalesce them
766+
* as it can always coalesce them
762767
*/
763-
return (mptcp_data_avail(mptcp_sk(sk)) >= sk->sk_rcvlowat) ||
768+
return (data_avail >= sk->sk_rcvlowat) ||
764769
(mem_cgroup_sockets_enabled && sk->sk_memcg &&
765770
mem_cgroup_under_socket_pressure(sk->sk_memcg)) ||
766771
READ_ONCE(tcp_memory_pressure);

0 commit comments

Comments
 (0)