]> git.baikalelectronics.ru Git - kernel.git/commit
net/socket: use per af lockdep classes for sk queues
authorPaolo Abeni <pabeni@redhat.com>
Thu, 9 Mar 2017 12:54:08 +0000 (13:54 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 10 Mar 2017 00:36:45 +0000 (16:36 -0800)
commitc5a3756c21ebdfc8e1c5bf3a552e3003931e39a0
tree437c5bb087a3ed2058d3368c0ffb6dd46baaa152
parent906a5de30eb8b934f2023044d53ea2d426235061
net/socket: use per af lockdep classes for sk queues

Currently the sock queue's spin locks get their lockdep
classes by the default init_spin_lock() initializer:
all socket families get - usually, see below - a single
class for rx, another specific class for tx, etc.
This can lead to false positive lockdep splat, as
reported by Andrey.
Moreover there are two separate initialization points
for the sock queues, one in sk_clone_lock() and one
in sock_init_data(), so that e.g. the rx queue lock
can get one of two possible, different classes, depending
on the socket being cloned or not.
This change tries to address the above, setting explicitly
a per address family lockdep class for each queue's
spinlock. Also, move the duplicated initialization code to a
single location.

v1 -> v2:
 - renamed the init helper

rfc -> v1:
 - no changes, tested with several different workload

Suggested-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/sock.c