qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 16/16] cpus-common: lock-free fast path for cpu_


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH 16/16] cpus-common: lock-free fast path for cpu_exec_start/end
Date: Sat, 24 Sep 2016 13:43:14 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0

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


----- Original Message -----
From: "Richard Henderson" <address@hidden>
To: "Paolo Bonzini" <address@hidden>, address@hidden
Cc: "serge fdrv" <address@hidden>, address@hidden, "alex bennee" <address@hidden>, 
"sergey fedorov"
<address@hidden>
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

[Prev in Thread] Current Thread [Next in Thread]