lkml.org 
[lkml]   [2015]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [RFC PATCH] sys_membarrier(): system/process-wide memory barrier (x86) (v12)
    On Sun, Mar 15, 2015 at 03:24:19PM -0400, Mathieu Desnoyers wrote:
    > Here is an implementation of a new system call, sys_membarrier(), which
    > executes a memory barrier on either all running threads of the current
    > process (MEMBARRIER_PRIVATE_FLAG) or calls synchronize_sched() to issue
    > a memory barrier on all threads running on the system. It can be used to
    > distribute the cost of user-space memory barriers asymmetrically by
    > transforming pairs of memory barriers into pairs consisting of
    > sys_membarrier() and a compiler barrier. For synchronization primitives
    > that distinguish between read-side and write-side (e.g. userspace RCU,
    > rwlocks), the read-side can be accelerated significantly by moving the
    > bulk of the memory barrier overhead to the write-side.

    From a quick review, this seems quite reasonable (as it did 5 years
    ago).

    One request: Could you please add a config option (default y) in the
    EXPERT menu to disable this? You actually seem to already have it
    marked as a cond_syscall.

    Also, a very minor nit: flags in kernel APIs aren't typically named with
    a _FLAG suffix.

    With the syscall made optional, and with or without that naming nit
    fixed:
    Reviewed-by: Josh Triplett <josh@joshtriplett.org>

    - Josh Triplett


    \
     
     \ /
      Last update: 2015-03-16 04:41    [W:2.889 / U:0.444 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site