Re: [Qemu-devel] [PATCH] linux-user: always start with parallel_cpus set to true

2017-01-04 Thread Richard Henderson
On 01/04/2017 12:22 PM, Laurent Vivier wrote: Yes, it's a good idea, but is it really expensive to always enable the parallel_cpus flag? It is somewhat expensive when the host does support the atomics being used; it is very expensive if the host does not. Of course the common case is x86_64

Re: [Qemu-devel] [PATCH] linux-user: always start with parallel_cpus set to true

2017-01-04 Thread Laurent Vivier
Le 04/01/2017 à 19:39, Alex Bennée a écrit : > > Laurent Vivier writes: > >> We always need real atomics, as we can have shared memory between >> processes. >> >> A good test case is the example from futex(2), futex_demo.c: >> >> the use case is >> >> mmap(...); >> fork(); >> >> Pare

Re: [Qemu-devel] [PATCH] linux-user: always start with parallel_cpus set to true

2017-01-04 Thread Laurent Vivier
Le 04/01/2017 à 20:35, Richard Henderson a écrit : > On 12/28/2016 09:37 AM, Laurent Vivier wrote: >> the use case is >> >> mmap(...); >> fork(); > > While true, we can notice that mmap contains MAP_SHARED, and trigger it > then. Similarly for shmat. Yes, it's a good idea, but is it reall

Re: [Qemu-devel] [PATCH] linux-user: always start with parallel_cpus set to true

2017-01-04 Thread Richard Henderson
On 12/28/2016 09:37 AM, Laurent Vivier wrote: the use case is mmap(...); fork(); While true, we can notice that mmap contains MAP_SHARED, and trigger it then. Similarly for shmat. r~

Re: [Qemu-devel] [PATCH] linux-user: always start with parallel_cpus set to true

2017-01-04 Thread Alex Bennée
Laurent Vivier writes: > We always need real atomics, as we can have shared memory between > processes. > > A good test case is the example from futex(2), futex_demo.c: > > the use case is > > mmap(...); > fork(); > > Parent and Child: > > while(...) > __sync_bool_compare

[Qemu-devel] [PATCH] linux-user: always start with parallel_cpus set to true

2016-12-28 Thread Laurent Vivier
We always need real atomics, as we can have shared memory between processes. A good test case is the example from futex(2), futex_demo.c: the use case is mmap(...); fork(); Parent and Child: while(...) __sync_bool_compare_and_swap(...) ... futex(...) In