1
0
Fork 0
alistair23-linux/net
Eric W. Biederman b099ce2602 net: Batch inet_twsk_purge
This function walks the whole hashtable so there is no point in
passing it a network namespace.  Instead I purge all timewait
sockets from dead network namespaces that I find.  If the namespace
is one of the once I am trying to purge I am guaranteed no new timewait
sockets can be formed so this will get them all.  If the namespace
is one I am not acting for it might form a few more but I will
call inet_twsk_purge again and  shortly to get rid of them.  In
any even if the network namespace is dead timewait sockets are
useless.

Move the calls of inet_twsk_purge into batch_exit routines so
that if I am killing a bunch of namespaces at once I will just
call inet_twsk_purge once and save a lot of redundant unnecessary
work.

My simple 4k network namespace exit test the cleanup time dropped from
roughly 8.2s to 1.6s.  While the time spent running inet_twsk_purge fell
to about 2ms.  1ms for ipv4 and 1ms for ipv6.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-12-03 12:23:47 -08:00
..
9p net: Move && and || to end of previous line 2009-11-29 16:55:45 -08:00
802 net: remove COMPAT_NET_DEV_OPS 2009-05-25 01:53:53 -07:00
8021q net: Teach vlans to cleanup as a pernet subsystem 2009-12-02 22:10:24 -08:00
appletalk net: use net_eq to compare nets 2009-11-25 15:14:13 -08:00
atm net: use net_eq to compare nets 2009-11-25 15:14:13 -08:00
ax25 net: use net_eq to compare nets 2009-11-25 15:14:13 -08:00
bluetooth net: Move && and || to end of previous line 2009-11-29 16:55:45 -08:00
bridge net: Move && and || to end of previous line 2009-11-29 16:55:45 -08:00
can net: Move && and || to end of previous line 2009-11-29 16:55:45 -08:00
core net: Allow fib_rule_unregister to batch 2009-12-03 12:22:55 -08:00
dcb net: Move && and || to end of previous line 2009-11-29 16:55:45 -08:00
dccp TCPCT part 1a: add request_values parameter for sending SYNACK 2009-12-02 22:07:23 -08:00
decnet net: Allow fib_rule_unregister to batch 2009-12-03 12:22:55 -08:00
dsa netdev: convert pseudo-devices to netdev_tx_t 2009-09-01 01:13:07 -07:00
econet net: use net_eq to compare nets 2009-11-25 15:14:13 -08:00
ethernet remove deprecated and not used: print_mac() 2009-11-15 22:21:34 -08:00
ieee802154 net: use net_eq to compare nets 2009-11-25 15:14:13 -08:00
ipv4 net: Batch inet_twsk_purge 2009-12-03 12:23:47 -08:00
ipv6 net: Batch inet_twsk_purge 2009-12-03 12:23:47 -08:00
ipx net: use net_eq to compare nets 2009-11-25 15:14:13 -08:00
irda net: Move && and || to end of previous line 2009-11-29 16:55:45 -08:00
iucv iucv: add work_queue cleanup for suspend 2009-11-13 20:46:58 -08:00
key net: Simplify af_key pernet operations. 2009-12-01 16:15:54 -08:00
lapb net: remove NET_RX_BAD and NET_RX_CN* defines 2009-07-05 19:15:35 -07:00
llc net: use net_eq to compare nets 2009-11-25 15:14:13 -08:00
mac80211 Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2009-12-01 22:13:38 -08:00
netfilter net: Simplify conntrack_proto_gre pernet operations. 2009-12-01 16:15:55 -08:00
netlabel net: rename skb->iif to skb->skb_iif 2009-11-20 15:35:04 -08:00
netlink net: use net_eq to compare nets 2009-11-25 15:14:13 -08:00
netrom net: use net_eq to compare nets 2009-11-25 15:14:13 -08:00
packet net: Move && and || to end of previous line 2009-11-29 16:55:45 -08:00
phonet net: Simplify phonet pernet operations. 2009-12-01 16:15:57 -08:00
rds net: Move && and || to end of previous line 2009-11-29 16:55:45 -08:00
rfkill Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2009-11-29 00:57:15 -08:00
rose net: Move && and || to end of previous line 2009-11-29 16:55:45 -08:00
rxrpc net: use net_eq to compare nets 2009-11-25 15:14:13 -08:00
sched net: Move && and || to end of previous line 2009-11-29 16:55:45 -08:00
sctp sctp: fix sctp_setsockopt_autoclose compile warning 2009-12-02 01:16:49 -08:00
sunrpc Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2009-12-01 22:13:38 -08:00
tipc net: Move && and || to end of previous line 2009-11-29 16:55:45 -08:00
unix net: Move && and || to end of previous line 2009-11-29 16:55:45 -08:00
wanrouter headers: smp_lock.h redux 2009-07-12 12:22:34 -07:00
wimax net: Move && and || to end of previous line 2009-11-29 16:55:45 -08:00
wireless net: Move && and || to end of previous line 2009-11-29 16:55:45 -08:00
x25 X25: Fix oops and refcnt problems from x25_dev_get 2009-11-29 00:25:02 -08:00
xfrm net: Allow xfrm_user_net_exit to batch efficiently. 2009-12-03 12:22:03 -08:00
Kconfig net/compat/wext: send different messages to compat tasks 2009-07-15 08:53:39 -07:00
Makefile net: remove redundant sched/ in net/Makefile 2009-07-12 20:11:14 -07:00
TUNABLE
compat.c net: compat_sys_recvmmsg user timespec arg can be NULL 2009-12-02 01:23:23 -08:00
nonet.c
socket.c net: compat_mmsghdr must be used in sys_recvmmsg 2009-12-02 01:23:23 -08:00
sysctl_net.c net: sysctl_net - use net_eq to compare nets 2009-03-16 16:23:30 +01:00