From patchwork Thu Nov 5 10:06:40 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 57884 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nA5EUEJ0010418 for ; Thu, 5 Nov 2009 14:30:14 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757194AbZKEOaH (ORCPT ); Thu, 5 Nov 2009 09:30:07 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757195AbZKEOaH (ORCPT ); Thu, 5 Nov 2009 09:30:07 -0500 Received: from charlotte.tuxdriver.com ([70.61.120.58]:57706 "EHLO smtp.tuxdriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757150AbZKEOaG (ORCPT ); Thu, 5 Nov 2009 09:30:06 -0500 Received: from uucp by smtp.tuxdriver.com with local-rmail (Exim 4.63) (envelope-from ) id 1N63Ln-0002dU-0Q for linux-wireless@vger.kernel.org; Thu, 05 Nov 2009 09:30:11 -0500 Received: from linville-t400.local (linville-t400.local [127.0.0.1]) by linville-t400.local (8.14.3/8.14.3) with ESMTP id nA5ENqLP002934 for ; Thu, 5 Nov 2009 09:23:52 -0500 Received: (from linville@localhost) by linville-t400.local (8.14.3/8.14.3/Submit) id nA5ENqbY002933 for linux-wireless@vger.kernel.org; Thu, 5 Nov 2009 09:23:52 -0500 Received: from gw1.cosmosbay.com ([212.99.114.194]) by smtp.tuxdriver.com with esmtp (Exim 4.63) (envelope-from ) id 1N5zEt-0001TO-42 for linville@tuxdriver.com; Thu, 05 Nov 2009 05:06:52 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) by gw1.cosmosbay.com (8.13.7/8.13.7) with ESMTP id nA5A6eeC008715; Thu, 5 Nov 2009 11:06:40 +0100 Message-ID: <4AF2A3B0.4030100@gmail.com> Date: Thu, 05 Nov 2009 11:06:40 +0100 From: Eric Dumazet User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: "David S. Miller" CC: Linux Netdev List , "John W. Linville" Subject: [PATCH net-next-2.6] mac80211: Speedup ieee80211_remove_interfaces() X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-1.6 (gw1.cosmosbay.com [0.0.0.0]); Thu, 05 Nov 2009 11:06:41 +0100 (CET) X-Spam-Score: -4.5 (----) X-Spam-Status: No Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index 14f10eb..a445f50 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c @@ -852,22 +852,18 @@ void ieee80211_if_remove(struct ieee80211_sub_if_data *sdata) void ieee80211_remove_interfaces(struct ieee80211_local *local) { struct ieee80211_sub_if_data *sdata, *tmp; + LIST_HEAD(unreg_list); ASSERT_RTNL(); + mutex_lock(&local->iflist_mtx); list_for_each_entry_safe(sdata, tmp, &local->interfaces, list) { - /* - * we cannot hold the iflist_mtx across unregister_netdevice, - * but we only need to hold it for list modifications to lock - * out readers since we're under the RTNL here as all other - * writers. - */ - mutex_lock(&local->iflist_mtx); list_del(&sdata->list); - mutex_unlock(&local->iflist_mtx); - unregister_netdevice(sdata->dev); + unregister_netdevice_queue(sdata->dev, &unreg_list); } + mutex_unlock(&local->iflist_mtx); + unregister_netdevice_many(&unreg_list); } static u32 ieee80211_idle_off(struct ieee80211_local *local,