]> git.baikalelectronics.ru Git - kernel.git/commit
tcp: refine rule to allow EPOLLOUT generation under mem pressure
authorEric Dumazet <edumazet@google.com>
Thu, 12 Dec 2019 20:55:31 +0000 (12:55 -0800)
committerJakub Kicinski <jakub.kicinski@netronome.com>
Sat, 14 Dec 2019 05:58:40 +0000 (21:58 -0800)
commit726587dc2adf3287fcdd02aa39a10f136332503f
tree99e290567b1943af5cf51b3cdfbf9f8f3752b6e8
parent8b2e6449070aed4a795589562d659b3120c9fee6
tcp: refine rule to allow EPOLLOUT generation under mem pressure

At the time commit dcfac0c9d509 ("tcp: ensure epoll edge trigger
wakeup when write queue is empty") was added to the kernel,
we still had a single write queue, combining rtx and write queues.

Once we moved the rtx queue into a separate rb-tree, testing
if sk_write_queue is empty has been suboptimal.

Indeed, if we have packets in the rtx queue, we probably want
to delay the EPOLLOUT generation at the time incoming packets
will free them, making room, but more importantly avoiding
flooding application with EPOLLOUT events.

Solution is to use tcp_rtx_and_write_queues_empty() helper.

Fixes: 42899b27ca39 ("tcp: implement rb-tree based retransmit queue")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Jason Baron <jbaron@akamai.com>
Cc: Neal Cardwell <ncardwell@google.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
net/ipv4/tcp.c