linux-stable/net/core
Eric Dumazet e014debecd linkwatch: linkwatch_forget_dev() to speedup device dismantle
Herbert Xu a écrit :
> On Tue, Nov 17, 2009 at 04:26:04AM -0800, David Miller wrote:
>> Really, the link watch stuff is just due for a redesign.  I don't
>> think a simple hack is going to cut it this time, sorry Eric :-)
>
> I have no objections against any redesigns, but since the only
> caller of linkwatch_forget_dev runs in process context with the
> RTNL, it could also legally emit those events.

Thanks guys, here an updated version then, before linkwatch surgery ?

In this version, I force the event to be sent synchronously.

[PATCH net-next-2.6] linkwatch: linkwatch_forget_dev() to speedup device dismantle

time ip link del eth3.103 ; time ip link del eth3.104 ; time ip link del eth3.105

real	0m0.266s
user	0m0.000s
sys	0m0.001s

real	0m0.770s
user	0m0.000s
sys	0m0.000s

real	0m1.022s
user	0m0.000s
sys	0m0.000s

One problem of current schem in vlan dismantle phase is the
holding of device done by following chain :

vlan_dev_stop() ->
	netif_carrier_off(dev) ->
		linkwatch_fire_event(dev) ->
			dev_hold() ...

And __linkwatch_run_queue() runs up to one second later...

A generic fix to this problem is to add a linkwatch_forget_dev() method
to unlink the device from the list of watched devices.

dev->link_watch_next becomes dev->link_watch_list (and use a bit more memory),
to be able to unlink device in O(1).

After patch :
time ip link del eth3.103 ; time ip link del eth3.104 ; time ip link del eth3.105

real    0m0.024s
user    0m0.000s
sys     0m0.000s

real    0m0.032s
user    0m0.000s
sys     0m0.001s

real    0m0.033s
user    0m0.000s
sys     0m0.000s

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-18 05:03:11 -08:00
..
datagram.c Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2009-11-06 00:55:55 -08:00
dev.c linkwatch: linkwatch_forget_dev() to speedup device dismantle 2009-11-18 05:03:11 -08:00
dev_mcast.c
drop_monitor.c net: Replace old style lock initializer 2009-11-07 00:46:34 -08:00
dst.c
ethtool.c ethtool: Add reset operation 2009-10-07 01:10:44 -07:00
fib_rules.c net: Remove unused parameter from fill method in fib_rules_ops. 2009-05-20 17:26:23 -07:00
filter.c filter: Add SKF_AD_QUEUE instruction 2009-10-20 01:06:22 -07:00
flow.c
gen_estimator.c net: restore gnet_stats_basic to previous definition 2009-08-17 21:33:49 -07:00
gen_stats.c pkt_sched: gen_estimator: Dont report fake rate estimators 2009-10-07 01:07:42 -07:00
iovec.c net: Fix memcpy_toiovecend() to use the right offset 2009-06-08 00:25:39 -07:00
kmap_skb.h
link_watch.c linkwatch: linkwatch_forget_dev() to speedup device dismantle 2009-11-18 05:03:11 -08:00
Makefile Network Drop Monitor: Adding Build changes to enable drop monitor 2009-03-13 12:09:29 -07:00
neighbour.c neigh: Convert garbage collection from softirq to workqueue 2009-08-02 18:35:16 -07:00
net-sysfs.c net: Allow devices to specify a device specific sysfs group. 2009-10-30 12:41:18 -07:00
net-sysfs.h
net-traces.c Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6 2009-06-15 03:02:23 -07:00
net_namespace.c Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2009-08-12 17:44:53 -07:00
netevent.c
netpoll.c Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2009-09-02 00:32:56 -07:00
pktgen.c pktgen: tx_bytes might be slightly wrong 2009-11-05 22:34:27 -08:00
request_sock.c
rtnetlink.c net: Support specifying the network namespace upon device creation. 2009-11-08 00:53:51 -08:00
scm.c
skb_dma_map.c net: skb_shared_info optimization 2009-06-08 00:21:48 -07:00
skbuff.c skbuff: Do not allow skb recycling with disabled IRQs 2009-11-11 19:03:28 -08:00
sock.c net: Fix build warning in sock_bindtodevice(). 2009-11-05 22:37:11 -08:00
stream.c tcp: tcp_prequeue() can use keyed wakeups 2009-05-17 20:44:43 -07:00
sysctl_net_core.c sysctl: fix sparse warning: Should it be static? 2009-02-26 23:13:34 -08:00
user_dma.c net/core/user_dma.c: Use frag list abstraction interfaces. 2009-06-09 00:19:10 -07:00
utils.c net: core: remove unneeded include in net/core/utils.c. 2009-03-26 01:11:48 -07:00