netdev
[Top] [All Lists]

Re: [PATCH] (1/4) remove hashbin from irlan

To: Stephen Hemminger <shemminger@xxxxxxxx>
Subject: Re: [PATCH] (1/4) remove hashbin from irlan
From: Jean Tourrilhes <jt@xxxxxxxxxxxxxxxxxx>
Date: Mon, 18 Aug 2003 12:00:46 -0700
Address: HP Labs, 1U-17, 1501 Page Mill road, Palo Alto, CA 94304, USA.
Cc: "David S. Miller" <davem@xxxxxxxxxx>, irda-users@xxxxxxxxxxxxxxxxxxxxx, netdev@xxxxxxxxxxx
E-mail: jt@xxxxxxxxxx
In-reply-to: <20030818113936.205b5632.shemminger@xxxxxxxx>
Organisation: HP Labs Palo Alto
References: <20030818113936.205b5632.shemminger@xxxxxxxx>
Reply-to: jt@xxxxxxxxxx
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mutt/1.3.28i
On Mon, Aug 18, 2003 at 11:39:36AM -0700, Stephen Hemminger wrote:
> The locking in hashbin_delete is a problem since unregister_netdevice
> can't be called with locks held in 2.6.0-test3.
> 
> Replace it with simpler list macros.
> Insertion/deletion protected with RTNL semaphore, and read
> uses RCU.
> 
> Don't have client hardware to test, but load/unload works on SMP.

        Why don't you try the much simpler version :
----------------------------------------------
--- irlan_common.h1.c   Mon Aug 18 11:57:39 2003
+++ irlan_common.c      Mon Aug 18 11:58:25 2003
@@ -125,7 +125,7 @@ int __init irlan_init(void)
 
        IRDA_DEBUG(0, "%s()\n", __FUNCTION__ );
        /* Allocate master structure */
-       irlan = hashbin_new(HB_LOCK);   /* protect from /proc */
+       irlan = hashbin_new(HB_NOLOCK); /* network layer will protect us */
        if (irlan == NULL) {
                printk(KERN_WARNING "IrLAN: Can't allocate hashbin!\n");
                return -ENOMEM;
----------------------------------------------
        We would still need the RCU, but the overall patch would be
much simpler and safer IMHO. But it's up to you ;-)

        Have fun...

        Jean

<Prev in Thread] Current Thread [Next in Thread>