Eric Dumazet 03f45c883c tcp: avoid extra wakeups for SO_RCVLOWAT users
SO_RCVLOWAT is properly handled in tcp_poll(), so that POLLIN is only
generated when enough bytes are available in receive queue, after
David change (commit c7004482e8dc "tcp: Respect SO_RCVLOWAT in tcp_poll().")

But TCP still calls sk->sk_data_ready() for each chunk added in receive
queue, meaning thread is awaken, and goes back to sleep shortly after.

Tested:

tcp_mmap test program, receiving 32768 MB of data with SO_RCVLOWAT set to 512KB

-> Should get ~2 wakeups (c-switches) per MB, regardless of how many
(tiny or big) packets were received.

High speed (mostly full size GRO packets)

received 32768 MB (100 % mmap'ed) in 8.03112 s, 34.2266 Gbit,
  cpu usage user:0.037 sys:1.404, 43.9758 usec per MB, 65497 c-switches

received 32768 MB (99.9954 % mmap'ed) in 7.98453 s, 34.4263 Gbit,
  cpu usage user:0.03 sys:1.422, 44.3115 usec per MB, 65485 c-switches

Low speed (sender is ratelimited and sends 1-MSS at a time, so GRO is not helping)

received 22474.5 MB (100 % mmap'ed) in 6015.35 s, 0.0313414 Gbit,
  cpu usage user:0.05 sys:1.586, 72.7952 usec per MB, 44950 c-switches

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-04-16 18:26:37 -04:00
..
2017-07-11 06:08:58 -04:00
2018-01-19 14:02:12 -05:00
2017-11-27 16:20:04 -05:00
2018-03-26 13:14:43 -04:00
2017-04-05 10:15:20 +02:00
2018-04-06 15:39:26 -07:00
2018-03-23 21:52:19 -04:00
2018-03-31 02:15:54 +02:00
2018-03-04 13:34:18 -05:00
2018-02-06 11:32:48 -05:00
2018-02-28 11:43:28 -05:00
2018-03-04 13:04:22 -05:00
2017-10-11 09:49:34 +02:00
2017-11-16 10:49:00 +09:00
2017-12-11 14:10:06 -05:00
2018-03-04 13:04:22 -05:00
2017-12-15 12:34:00 -05:00
2018-03-31 23:25:39 -04:00
2018-04-07 22:32:31 -04:00
2017-11-08 16:12:33 +09:00
2017-12-05 14:37:13 -05:00
2017-12-04 11:32:53 -05:00
2018-04-05 21:36:24 -07:00
2018-03-31 23:37:32 -04:00
2018-03-31 02:15:54 +02:00
2018-01-17 16:07:24 -05:00