Re: Is module refcounting racy?

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Nick Piggin
Date: Tuesday, April 6, 2010 - 12:38 am

On Tue, Apr 06, 2010 at 08:19:23AM +0200, Eric Dumazet wrote:

Yep. smp_wmb() and smp_rmb() are both noops on x86 (OOSTORE is some
really obscure thing that we don't need to worry about really). On
POWER6/7 CPUs, it uses lwsync which is fairly cheap as well.

I think refcounting in _general_ needs a smp_wmb() (or, to be more
precise, probably a release barrier) before decrements because you don't
want previous futzing with the object to leak into after a final
decrement may be observed by another CPU. So it might be hard to avoid
anyway.

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Is module refcounting racy?, Nick Piggin, (Thu Mar 18, 3:55 am)
Re: Is module refcounting racy?, Rusty Russell, (Mon Mar 29, 2:12 am)
Re: Is module refcounting racy?, Nick Piggin, (Mon Mar 29, 9:58 am)
Re: Is module refcounting racy?, Rusty Russell, (Tue Mar 30, 8:44 pm)
Re: Is module refcounting racy?, Nick Piggin, (Thu Apr 1, 1:09 am)
Re: Is module refcounting racy?, Linus Torvalds, (Thu Apr 1, 8:55 am)
Re: Is module refcounting racy?, Rusty Russell, (Mon Apr 5, 7:39 pm)
Re: Is module refcounting racy?, Nick Piggin, (Mon Apr 5, 10:05 pm)
Re: Is module refcounting racy?, Eric Dumazet, (Mon Apr 5, 11:19 pm)
Re: Is module refcounting racy?, Nick Piggin, (Tue Apr 6, 12:38 am)