[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BANLkTim2e1Gm_jqfY89is-FfRYTu2=G02w@mail.gmail.com>
Date: Mon, 9 May 2011 08:56:26 +0200
From: Michał Mirosław <mirqus@...il.com>
To: Eric Dumazet <eric.dumazet@...il.com>
Cc: David Miller <davem@...emloft.net>, Alex Bligh <alex@...x.org.uk>,
netdev@...r.kernel.org, Jesse Gross <jesse@...ira.com>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
Ben Greear <greearb@...delatech.com>
Subject: Re: [PATCH] veth: use batched device unregister
2011/5/9 Eric Dumazet <eric.dumazet@...il.com>:
> veth devices dont use the batched device unregisters yet.
>
> Since veth are a pair of devices, it makes sense to use a batch of two
> unregisters, this roughly divide dismantle time by two.
[...]
> --- a/drivers/net/veth.c
> +++ b/drivers/net/veth.c
> @@ -451,8 +451,16 @@ static void veth_dellink(struct net_device *dev, struct list_head *head)
> priv = netdev_priv(dev);
> peer = priv->peer;
>
> - unregister_netdevice_queue(dev, head);
> - unregister_netdevice_queue(peer, head);
> + if (head == NULL) {
> + LIST_HEAD(list);
> + /* make a batch of two devices to speedup unregister */
> + unregister_netdevice_queue(dev, &list);
> + unregister_netdevice_queue(peer, &list);
> + unregister_netdevice_many(&list);
> + } else {
> + unregister_netdevice_queue(dev, head);
> + unregister_netdevice_queue(peer, head);
> + }
You could change dellink callers to always pass head != NULL. As a
side effect, unregister_netdevice_queue() would do just what its name
suggests.
Best Regards,
Michał Mirosław
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists