lkml.org 
[lkml]   [2005]   [Oct]   [26]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateWed, 26 Oct 2005 21:05:24 +0200 (CEST)
FromAndreas Kleen <>
SubjectRe: Notifier chains are unsafe
>
> On 26 Oct 2005, Andi Kleen wrote:
>
> > If you add locks to the reader make sure it is only taken
> > if the list is non empty. Otherwise you will add unacceptable
> > overhead to some fast paths.
>
> I don't understand this comment. What point is there in avoiding a
> lock
> when the list is empty?
 
It doesn't add locking overhead for a common case.
 
> Did you mean that a lock should be taken only if
> the list _is_ empty?

No.

> > Better would be likely to use RCU.
>
> Note that the RCU documentation says RCU critical sections are not
> allowed
> to sleep.
 
In this case it would be ok.

 
-Andi

-
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/

\
 
 \ /
  Last update: 2005-10-26 19:08    [from the cache]
©2003-2008