]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Add a new global rwlock, in_ifaddr_lock, which will synchronize use of the
authorRobert Watson <rwatson@FreeBSD.org>
Thu, 25 Jun 2009 11:52:33 +0000 (11:52 +0000)
committerRobert Watson <rwatson@FreeBSD.org>
Thu, 25 Jun 2009 11:52:33 +0000 (11:52 +0000)
commit2d9cfabad4b7d8d7589a825030ac7165b29a6e00
treef7bd2b06a93cabd18d4d4396239234b49517bc87
parent51500a4872e675ba5a0642a04272551dfc84bb18
Add a new global rwlock, in_ifaddr_lock, which will synchronize use of the
in_ifaddrhead and INADDR_HASH address lists.

Previously, these lists were used unsynchronized as they were effectively
never changed in steady state, but we've seen increasing reports of
writer-writer races on very busy VPN servers as core count has gone up
(and similar configurations where address lists change frequently and
concurrently).

For the time being, use rwlocks rather than rmlocks in order to take
advantage of their better lock debugging support.  As a result, we don't
enable ip_input()'s read-locking of INADDR_HASH until an rmlock conversion
is complete and a performance analysis has been done.  This means that one
class of reader-writer races still exists.

MFC after:      6 weeks
Reviewed by:    bz
15 files changed:
sys/fs/nfsclient/nfs_clvnops.c
sys/net/if_spppsubr.c
sys/net/if_stf.c
sys/netinet/if_ether.c
sys/netinet/in.c
sys/netinet/in_gif.c
sys/netinet/in_mcast.c
sys/netinet/in_pcb.c
sys/netinet/in_var.h
sys/netinet/ip_carp.c
sys/netinet/ip_icmp.c
sys/netinet/ip_input.c
sys/netinet/raw_ip.c
sys/netipsec/key.c
sys/nfsclient/nfs_vnops.c