]> git.baikalelectronics.ru Git - kernel.git/commit
tuntap: RCUify dereferencing between tun_struct and tun_file
authorJason Wang <jasowang@redhat.com>
Wed, 31 Oct 2012 19:45:58 +0000 (19:45 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 1 Nov 2012 15:14:07 +0000 (11:14 -0400)
commit8adebfc2a034bcc4cef86b3d9064de89cf176a5f
tree4f140c57638a42b7969b158e4fd0b6e4df8ecc11
parentd5e4740f13e091a3c3cb0408370d7c4ef329a780
tuntap: RCUify dereferencing between tun_struct and tun_file

RCU were introduced in this patch to synchronize the dereferences between
tun_struct and tun_file. All tun_{get|put} were replaced with RCU, the
dereference from one to other must be done under rtnl lock or rcu read critical
region.

This is needed for the following patches since the one of the goal of multiqueue
tuntap is to allow adding or removing queues during workload. Without RCU,
control path would hold tx locks when adding or removing queues (which may cause
sme delay) and it's hard to change the number of queues without stopping the net
device. With the help of rcu, there's also no need for tun_file hold an refcnt
to tun_struct.

Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/tun.c