Messages in this thread | | | Subject | Re: [PATCH 1/2] percpu-rw-semaphores: use light/heavy barriers | From | Peter Zijlstra <> | Date | Tue, 23 Oct 2012 22:32:48 +0200 |
| |
On Mon, 2012-10-22 at 19:37 -0400, Mikulas Patocka wrote: > - /* > - * On X86, write operation in this_cpu_dec serves as a memory unlock > - * barrier (i.e. memory accesses may be moved before the write, but > - * no memory accesses are moved past the write). > - * On other architectures this may not be the case, so we need smp_mb() > - * there. > - */ > -#if defined(CONFIG_X86) && (!defined(CONFIG_X86_PPRO_FENCE) && !defined(CONFIG_X86_OOSTORE)) > - barrier(); > -#else > - smp_mb(); > -#endif > + light_mb(); /* B, between read of the data and write to p->counter, paired with C */
If we're going to invent new primitives for this, shouldn't we call this: smp_unlock_barrier() or something? That at least has well defined semantics.
| |