Re: Notifier chains are unsafe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>
> 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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux