From: Stephen Hemminger <shemminger@linux-foundation.org>
To: Wang Chen <wangchen@cn.fujitsu.com>
Cc: "David S. Miller" <davem@davemloft.net>,
Jeff Garzik <jgarzik@pobox.com>,
netdev@vger.kernel.org, Wang Chen <wangchen@cn.fujitsu.com>
Subject: Re: [PATCH 4/4] sky2: rtnl_lock out of loop will be faster
Date: Wed, 12 Dec 2007 08:30:11 -0800 [thread overview]
Message-ID: <20071212083011.731773b9@freepuppy.rosehill> (raw)
In-Reply-To: <475FA0C1.8000701@cn.fujitsu.com>
On Wed, 12 Dec 2007 16:50:09 +0800
Wang Chen <wangchen@cn.fujitsu.com> wrote:
> [PATCH 4/4] [NETDEV] sky2: rtnl_lock out of loop will be faster
>
> Before this patch, it gets and releases the lock at each
> iteration of the loop. Changing unregister_netdev to
> unregister_netdevice and locking outside of the loop will
> be faster for this approach.
>
> Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>
> ---
> sky2.c | 4 +++-
> 1 files changed, 3 insertions(+), 1 deletion(-)
>
> --- linux-2.6.24.rc5.org/drivers/net/sky2.c 2007-12-12 10:19:43.000000000 +0800
> +++ linux-2.6.24.rc5/drivers/net/sky2.c 2007-12-12 15:23:37.000000000 +0800
> @@ -4270,8 +4270,10 @@ static void __devexit sky2_remove(struct
> del_timer_sync(&hw->watchdog_timer);
> cancel_work_sync(&hw->restart_work);
>
> + rtnl_lock();
> for (i = hw->ports-1; i >= 0; --i)
> - unregister_netdev(hw->dev[i]);
> + unregister_netdevice(hw->dev[i]);
> + rtnl_unlock();
>
> sky2_write32(hw, B0_IMSK, 0);
>
Umm, okay but it doesn't matter really, there can only be 2 ports and
90+% of the boards only have one port. So why bother??
--
Stephen Hemminger <shemminger@linux-foundation.org>
next prev parent reply other threads:[~2007-12-12 16:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-12 8:50 [PATCH 4/4] sky2: rtnl_lock out of loop will be faster Wang Chen
2007-12-12 16:30 ` Stephen Hemminger [this message]
2007-12-13 6:26 ` Wang Chen
2007-12-14 21:17 ` Jeff Garzik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071212083011.731773b9@freepuppy.rosehill \
--to=shemminger@linux-foundation.org \
--cc=davem@davemloft.net \
--cc=jgarzik@pobox.com \
--cc=netdev@vger.kernel.org \
--cc=wangchen@cn.fujitsu.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox