lkml.org 
[lkml]   [2012]   [Oct]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/2] percpu-rw-semaphores: use light/heavy barriers
From
Date
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.




\
 
 \ /
  Last update: 2012-10-27 16:01    [W:0.191 / U:0.564 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site