On 09/24/2016 04:52 AM, Paolo Bonzini wrote:


----- Original Message -----
From: "Richard Henderson" <r...@twiddle.net>
To: "Paolo Bonzini" <pbonz...@redhat.com>, qemu-devel@nongnu.org
Cc: "serge fdrv" <serge.f...@gmail.com>, c...@braap.org, "alex bennee" 
<alex.ben...@linaro.org>, "sergey fedorov"
<sergey.fedo...@linaro.org>
Sent: Friday, September 23, 2016 8:23:46 PM
Subject: Re: [Qemu-devel] [PATCH 16/16] cpus-common: lock-free fast path for 
cpu_exec_start/end

On 09/23/2016 12:31 AM, Paolo Bonzini wrote:
+        if (atomic_read(&other_cpu->running)) {
...
+    atomic_set(&cpu->running, true);
...
+            cpu->running = false;
...
+            cpu->running = true;

Inconsistent use of atomics.  I don't see that the cpu_list_lock protects the
last two lines in any way.

It does:

        qemu_mutex_lock(&qemu_cpu_list_lock);

What I meant is that I don't see that the mutex avoids the need for atomic_set.

but I can change it anyway to atomic_set.

Thanks,


r~

Reply via email to