]> git.baikalelectronics.ru Git - kernel.git/commit
af_packet: TPACKET_V3: replace busy-wait loop
authorJohn Ogness <john.ogness@linutronix.de>
Tue, 7 Jul 2020 15:22:04 +0000 (17:28 +0206)
committerJakub Kicinski <kuba@kernel.org>
Thu, 16 Jul 2020 18:40:39 +0000 (11:40 -0700)
commit39d698d2d50700067b4860250a6d29e22bfe9d1f
tree17ed0b6ce864b175f2849f7518b7648853618f3c
parentcd0b69974c54bcb1288646cb241e95ed86b2070d
af_packet: TPACKET_V3: replace busy-wait loop

A busy-wait loop is used to implement waiting for bits to be copied
from the skb to the kernel buffer before retiring a block. This is
a problem on PREEMPT_RT because the copying task could be preempted
by the busy-waiting task and thus live lock in the busy-wait loop.

Replace the busy-wait logic with an rwlock_t. This provides lockdep
coverage and makes the code RT ready.

Signed-off-by: John Ogness <john.ogness@linutronix.de>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/packet/af_packet.c
net/packet/internal.h