Skip to content

net: sched: Do not drop root lock in tcf_qevent_handle()

Petr Machata netdev 3 versions Applied

Status from this message: Applied, thanks.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 1 replyApplied
  2. v22 patches 2 repliesSuperseded
  3. v12 patches 2 repliesSuperseded

Changes in v3 from the cover letter

- Patch #2:
- Add a S-o-b.

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/2net: sched: Do not drop root lock in tcf_qevent_handle()include/net/pkt_cls.h net/sched/cls_api.c net/sched/sch_red.c+6 -120 replies
2/2Revert "net: sched: Pass root lock to Qdisc_ops.enqueue"include/net/sch_generic.h net/core/dev.c net/sched/sch_atm.c +32 more+71 -730 replies

Reviews trailers per patch

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

Read the v3 thread

Cover letter [PATCH net-next v3 0/2] net: sched: Do not drop root lock in tcf_qevent_handle()

Mirred currently does not mix well with blocks executed after the qdisc root lock is taken. This includes classification blocks (such as in PRIO, ETS, DRR qdiscs) and qevents. The locking caused by the packet mirrored by mirred can cause deadlocks: either when the thread of execution attempts to take the lock a second time, or when two threads end up waiting on each other's locks.

The qevent patchset attempted to not introduce further badness of this sort, and dropped the lock before executing the qevent block. However this lead to too little locking and races between qdisc configuration and packet enqueue in the RED qdisc.

Before the deadlock issues are solved in a way that can be applied across many qdiscs reasonably easily, do for qevents what is done for the classification blocks and just keep holding the root lock.

That is done in patch #1. Patch #2 then drops the now unnecessary root_lock argument from Qdisc_ops.enqueue.

v3:
- Patch #2:
- Add a S-o-b.

v2:
- Patch #2:
- Turn this into a proper revert. No actual changes.

Petr Machata (2):
net: sched: Do not drop root lock in tcf_qevent_handle() Revert "net: sched: Pass root lock to Qdisc_ops.enqueue"

 include/net/pkt_cls.h     |  4 ++--
 include/net/sch_generic.h |  6 ++----
 net/core/dev.c            |  4 ++--
 net/sched/cls_api.c       |  8 +-------
 net/sched/sch_atm.c       |  4 ++--
 net/sched/sch_blackhole.c |  2 +-
 net/sched/sch_cake.c      |  2 +-
 net/sched/sch_cbq.c       |  4 ++--
 net/sched/sch_cbs.c       | 18 +++++++++---------
 net/sched/sch_choke.c     |  2 +-
 net/sched/sch_codel.c     |  2 +-
 net/sched/sch_drr.c       |  4 ++--
 net/sched/sch_dsmark.c    |  4 ++--
 net/sched/sch_etf.c       |  2 +-
 net/sched/sch_ets.c       |  4 ++--
 net/sched/sch_fifo.c      |  6 +++---
 net/sched/sch_fq.c        |  2 +-
 net/sched/sch_fq_codel.c  |  2 +-
 net/sched/sch_fq_pie.c    |  2 +-
 net/sched/sch_generic.c   |  4 ++--
 net/sched/sch_gred.c      |  2 +-
 net/sched/sch_hfsc.c      |  6 +++---
 net/sched/sch_hhf.c       |  2 +-
 net/sched/sch_htb.c       |  4 ++--
 net/sched/sch_multiq.c    |  4 ++--
 net/sched/sch_netem.c     |  8 ++++----
 net/sched/sch_pie.c       |  2 +-
 net/sched/sch_plug.c      |  2 +-
 net/sched/sch_prio.c      |  6 +++---
 net/sched/sch_qfq.c       |  4 ++--
 net/sched/sch_red.c       | 10 +++++-----
 net/sched/sch_sfb.c       |  4 ++--
 net/sched/sch_sfq.c       |  2 +-
 net/sched/sch_skbprio.c   |  2 +-
 net/sched/sch_taprio.c    |  4 ++--
 net/sched/sch_tbf.c       | 10 +++++-----
 net/sched/sch_teql.c      |  4 ++--
 37 files changed, 77 insertions(+), 85 deletions(-)
Signature · 1 line
2.20.1