]> git.baikalelectronics.ru Git - kernel.git/commit
Merge branch 'net-sched-do-not-drop-root-lock-in-tcf_qevent_handle'
authorJakub Kicinski <kuba@kernel.org>
Thu, 16 Jul 2020 23:48:47 +0000 (16:48 -0700)
committerJakub Kicinski <kuba@kernel.org>
Thu, 16 Jul 2020 23:48:47 +0000 (16:48 -0700)
commite35c09a679c6b3d84917cdb64523b12566c0264a
tree4a873e972e1bcde088a7204b4511299ddcbf04fd
parenta4c8fda1b60da6dc5f6f66603ebd5ae1691a171f
parent5e72bdf169350653d98e490a44d1d427cffeb101
Merge branch 'net-sched-do-not-drop-root-lock-in-tcf_qevent_handle'

Petr Machata says:

====================
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.
====================

Signed-off-by: Jakub Kicinski <kuba@kernel.org>