Re: [Qemu-devel] [RFC 05/38] thread-posix: inline qemu_spin functions

2015-08-25 Thread Paolo Bonzini
> > I just tested a fetch-and-swap+exp.backoff spinlock with usermode on a > > program that spawns N threads and each thread performs an 2**M atomic > > increments > > on the same variable. That is, a degenerate worst-case kind of contention. > > N varies from 1 to 64, and M=15 on all runs, 5 runs

Re: [Qemu-devel] [RFC 05/38] thread-posix: inline qemu_spin functions

2015-08-25 Thread Emilio G. Cota
On Mon, Aug 24, 2015 at 22:30:03 -0400, Emilio G. Cota wrote: > On Sun, Aug 23, 2015 at 18:04:46 -0700, Paolo Bonzini wrote: > > On 23/08/2015 17:23, Emilio G. Cota wrote: > (snip) > > Applied, but in the end the spinlock will probably simply use a simple > > test-and-test-and-set lock, or an MCS l

Re: [Qemu-devel] [RFC 05/38] thread-posix: inline qemu_spin functions

2015-08-24 Thread Emilio G. Cota
On Sun, Aug 23, 2015 at 18:04:46 -0700, Paolo Bonzini wrote: > On 23/08/2015 17:23, Emilio G. Cota wrote: > > On some parallel workloads this gives up to a 15% speed improvement. > > > > Signed-off-by: Emilio G. Cota > > --- > > include/qemu/thread-posix.h | 47 ++

Re: [Qemu-devel] [RFC 05/38] thread-posix: inline qemu_spin functions

2015-08-24 Thread Paolo Bonzini
On 23/08/2015 17:23, Emilio G. Cota wrote: > On some parallel workloads this gives up to a 15% speed improvement. > > Signed-off-by: Emilio G. Cota > --- > include/qemu/thread-posix.h | 47 ++ > include/qemu/thread.h | 6 -- > util/qemu-thread

[Qemu-devel] [RFC 05/38] thread-posix: inline qemu_spin functions

2015-08-24 Thread Emilio G. Cota
On some parallel workloads this gives up to a 15% speed improvement. Signed-off-by: Emilio G. Cota --- include/qemu/thread-posix.h | 47 ++ include/qemu/thread.h | 6 -- util/qemu-thread-posix.c| 50 +-