netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@osdl.org>
To: jt@hpl.hp.com
Cc: jt@bougret.hpl.hp.com, "David S. Miller" <davem@redhat.com>,
	irda-users@lists.sourceforge.net, netdev@oss.sgi.com
Subject: Re: [PATCH] (1/4) remove hashbin from irlan
Date: Mon, 18 Aug 2003 12:34:21 -0700	[thread overview]
Message-ID: <20030818123421.64ee3ff2.shemminger@osdl.org> (raw)
In-Reply-To: <20030818190046.GA6577@bougret.hpl.hp.com>

On Mon, 18 Aug 2003 12:00:46 -0700
Jean Tourrilhes <jt@bougret.hpl.hp.com> wrote:

> 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

It really is a personal choice; there is no "right and wrong", but
I felt more secure using the same locking and list model as other network
drivers.  You probably feel more secure using the hashbin stuff that the
rest of the IRDA stack does.

Also, RCU is well tested and if something comes up, it would get fixed
in list.h.  I wouldn't trust hashbin's with RCU without explicit testing
and review by Paul or Dipankar.

  reply	other threads:[~2003-08-18 19:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-18 18:39 [PATCH] (1/4) remove hashbin from irlan Stephen Hemminger
2003-08-18 19:00 ` Jean Tourrilhes
2003-08-18 19:34   ` Stephen Hemminger [this message]
2003-08-20  4:13 ` David S. Miller

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=20030818123421.64ee3ff2.shemminger@osdl.org \
    --to=shemminger@osdl.org \
    --cc=davem@redhat.com \
    --cc=irda-users@lists.sourceforge.net \
    --cc=jt@bougret.hpl.hp.com \
    --cc=jt@hpl.hp.com \
    --cc=netdev@oss.sgi.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;
as well as URLs for NNTP newsgroup(s).