Skip to content

RFC net: Qdisc backpressure infrastructure

Peilin Ye linux-doc linux-mm lkml netdev 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 RFC Latest5 patches 11 repliesIn review
  2. v1 RFC4 patches 7 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5net: Introduce Qdisc backpressure infrastructureinclude/net/sch_generic.h include/net/sock.h net/core/sock.c+33 -00 replies
2/5net/udp: Implement Qdisc backpressure algorithmDocumentation/networking/ip-sysctl.rst include/linux/udp.h include/net/netns/ipv4.h +5 more+94 -41 reply
3/5net/sched: sch_tbf: Use Qdisc backpressure infrastructurenet/sched/sch_tbf.c+2 -00 replies
4/5net/sched: sch_htb: Use Qdisc backpressure infrastructurenet/sched/sch_htb.c+2 -00 replies
5/5net/sched: sch_cbq: Use Qdisc backpressure infrastructurenet/sched/sch_cbq.c+1 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH RFC v2 net-next 0/5] net: Qdisc backpressure infrastructure

From: Peilin Ye <[email protected]>

Hi all,

Currently sockets (especially UDP ones) can drop a lot of packets at TC egress when rate limited by shaper Qdiscs like HTB. This patchset series tries to solve this by introducing a Qdisc backpressure mechanism.

RFC v1 [1] used a throttle & unthrottle approach, which introduced several issues, including a thundering herd problem and a socket reference count issue [2]. This RFC v2 uses a different approach to avoid those issues:

1. When a shaper Qdisc drops a packet that belongs to a local socket due to TC egress congestion, we make part of the socket's sndbuf temporarily unavailable, so it sends slower.

2. Later, when TC egress becomes idle again, we gradually recover the socket's sndbuf back to normal. Patch 2 implements this step using a timer for UDP sockets.

The thundering herd problem is avoided, since we no longer wake up all throttled sockets at the same time in qdisc_watchdog(). The socket reference count issue is also avoided, since we no longer maintain socket list on Qdisc.

Performance is better than RFC v1. There is one concern about fairness between flows for TBF Qdisc, which could be solved by using a SFQ inner Qdisc.

Please see the individual patches for details and numbers. Any comments, suggestions would be much appreciated. Thanks!

[1] https://lore.kernel.org/netdev/[email protected]/
[2] https://lore.kernel.org/netdev/[email protected]/

Peilin Ye (5):
net: Introduce Qdisc backpressure infrastructure net/udp: Implement Qdisc backpressure algorithm net/sched: sch_tbf: Use Qdisc backpressure infrastructure net/sched: sch_htb: Use Qdisc backpressure infrastructure net/sched: sch_cbq: Use Qdisc backpressure infrastructure

 Documentation/networking/ip-sysctl.rst | 11 ++++
 include/linux/udp.h                    |  3 ++
 include/net/netns/ipv4.h               |  1 +
 include/net/sch_generic.h              | 11 ++++
 include/net/sock.h                     | 21 ++++++++
 include/net/udp.h                      |  1 +
 net/core/sock.c                        |  5 +-
 net/ipv4/sysctl_net_ipv4.c             |  7 +++
 net/ipv4/udp.c                         | 69 +++++++++++++++++++++++++-
 net/ipv6/udp.c                         |  2 +-
 net/sched/sch_cbq.c                    |  1 +
 net/sched/sch_htb.c                    |  2 +
 net/sched/sch_tbf.c                    |  2 +
 13 files changed, 132 insertions(+), 4 deletions(-)
Signature · 1 line
2.20.1