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


----- Original Message -----
From: "Richard Henderson" <[email protected]>
To: "Paolo Bonzini" <[email protected]>, [email protected]
Cc: "serge fdrv" <[email protected]>, [email protected], "alex bennee" 
<[email protected]>, "sergey fedorov"
<[email protected]>
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