All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chandra Seetharaman <sekharan@us.ibm.com>
To: Joe Seigh <jseigh_02@xemaps.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Notifier chains are unsafe
Date: Thu, 27 Oct 2005 18:36:36 -0700	[thread overview]
Message-ID: <1130463396.3586.282.camel@linuxchandra> (raw)
In-Reply-To: <djp9r4$8dj$1@sea.gmane.org>

On Wed, 2005-10-26 at 21:17 -0400, Joe Seigh wrote:
> Chandra Seetharaman wrote:
> > Andy, comment above rcu_read_lock says, "It is illegal to block while in
> > an RCU read-side critical section."
> > 
> > As i mentioned in the other email we are discussing about "task
> > notifier" in lse-tech. We thought of using RCU, but one of the
> > requirements was that the registered function should be able to block,
> > so we are looking for alternatives.
> > 
> 
> What are the requirements that preclude a conventional rwlock?  If you
> don't have any, then you should go with that.

I was thinking the problem is that we cannot hold any locks while
calling the callouts.

But, As Keith mentioned, we cannot even acquire a lock in the
notifier_call_chain.

Thanks,

chandra  
> 
> The other solutions I've mentioned before.
> 
> Copy on read.
> 
> Various lock-free schemes:
> SMR hazard pointers
> RCU+SMR (probably overkill since you don't need the read side performance)
> reference counting
> proxy reference counting
> 
> The last would probably be the easiest to implement expecially if you used
> a spinlock to safely increment the reference count without the more complicated
> atomic thread-safety.  It's also more self contained.
> 
> User land implementations of most of the above can be found at
> http://sourceforge.net/projects/atomic-ptr-plus/
> 
> The proxy refcounting stuff is in the atomic-ptr-plus package.  It's
> in c++ but you should be able to figure it out.
> 
> RCU+SMR is in the fastsmr package.
> 
> 
> 
> --
> Joe Seigh
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 
> 
-- 

----------------------------------------------------------------------
    Chandra Seetharaman               | Be careful what you choose....
              - sekharan@us.ibm.com   |      .......you may get it.
----------------------------------------------------------------------



  reply	other threads:[~2005-10-28  1:36 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-24 20:48 Notifier chains are unsafe Alan Stern
2005-10-25 16:59 ` Joe Seigh
2005-10-25 23:30 ` Chandra Seetharaman
2005-10-26 18:46   ` Alan Stern
2005-10-26 19:05     ` Andreas Kleen
2005-10-26 20:40       ` Alan Stern
2005-10-26 21:44         ` Andi Kleen
2005-10-26 23:20           ` Chandra Seetharaman
2005-10-27  1:17             ` Joe Seigh
2005-10-28  1:36               ` Chandra Seetharaman [this message]
2005-10-27 14:13           ` Alan Stern
2005-10-26 22:40     ` Chandra Seetharaman
2005-10-27 15:28       ` Alan Stern
2005-10-27 20:43         ` Chandra Seetharaman
2005-10-27 21:21           ` Alan Stern
2005-10-27 23:02             ` Chandra Seetharaman
2005-10-28  0:48               ` Keith Owens
2005-10-28  1:34                 ` Chandra Seetharaman
2005-10-28 14:23                   ` Alan Stern
2005-10-28 22:15                     ` Chandra Seetharaman
2005-10-29 14:51                       ` Alan Stern
2005-10-31 22:22                         ` Chandra Seetharaman
2005-11-01 15:24                           ` Alan Stern
2005-11-01 20:20                             ` Chandra Seetharaman
2005-11-01 21:20                               ` Alan Stern
2005-11-02  9:50                                 ` Keith Owens
2005-11-02 16:03                                   ` Alan Stern
     [not found]               ` <mailman.1130460600.30060.linux-kernel2news@redhat.com>
2005-10-28  4:35                 ` Pete Zaitcev
2005-10-25 23:43 ` Andi Kleen
2005-10-26  0:01   ` Chandra Seetharaman
2005-10-26 17:11     ` Andreas Kleen
2005-10-27  2:46       ` Herbert Xu
2005-10-29 12:25         ` Joe Seigh
2005-10-26  6:11 ` Keith Owens

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=1130463396.3586.282.camel@linuxchandra \
    --to=sekharan@us.ibm.com \
    --cc=jseigh_02@xemaps.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.