membarrier: add --enable-membarrier
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 16 Feb 2018 09:05:23 +0000 (10:05 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 12 Mar 2018 15:12:47 +0000 (16:12 +0100)
commita40161cbe9ccbcbab798c3e4d257c4bba99d153a
treefe6cc9bb0a5a3253a59d0187a5266573a2b81e16
parentc8d3877e48c4f57381d72eaf8d016bff12ce2d7c
membarrier: add --enable-membarrier

Actually enable the global memory barriers if supported by the OS.
Because only recent versions of Linux include the support, they
are disabled by default.  Note that it also has to be disabled
for QEMU to run under Wine.

Before this patch, rcutorture reports 85 ns/read for my machine,
after the patch it reports 12.5 ns/read.  On the other hand updates
go from 50 *micro*seconds to 20 *milli*seconds.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
configure
include/qemu/sys_membarrier.h
util/Makefile.objs
util/sys_membarrier.c [new file with mode: 0644]