]> git.baikalelectronics.ru Git - kernel.git/commit
netpoll: more efficient locking
authorEric Dumazet <edumazet@google.com>
Wed, 16 Nov 2016 22:54:50 +0000 (14:54 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 16 Nov 2016 23:32:02 +0000 (18:32 -0500)
commitf25cc6d2d5db3533d2f0341cd0c899a61f9beaad
tree825a8d6e04cdc937950e9d8a79b52eeb249236c3
parentea218d5da8cdee546855a1a05c75e90835531410
netpoll: more efficient locking

Callers of netpoll_poll_lock() own NAPI_STATE_SCHED

Callers of netpoll_poll_unlock() have BH blocked between
the NAPI_STATE_SCHED being cleared and poll_lock is released.

We can avoid the spinlock which has no contention, and use cmpxchg()
on poll_owner which we need to set anyway.

This removes a possible lockdep violation after the cited commit,
since sk_busy_loop() re-enables BH before calling busy_poll_stop()

Fixes: 63fbe3f17810 ("net: busy-poll: allow preemption in sk_busy_loop()")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/netdevice.h
include/linux/netpoll.h
net/core/dev.c
net/core/netpoll.c