qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 00/18] Block layer thread safety, part 1


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH v2 00/18] Block layer thread safety, part 1
Date: Thu, 25 May 2017 18:17:47 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0


On 25/05/2017 09:40, Fam Zheng wrote:
> On Wed, 05/24 10:32, Paolo Bonzini wrote:
>>
>> Ping?
>>
> 
> Looks good to me except for the mingw 32bit build failure reported by patchew:
> 
> http://patchew.org/QEMU/address@hidden/
> 
> Do you want to fix it?

Yes, I misread the code.

Here is the fix:

diff --git a/include/qemu/stats64.h b/include/qemu/stats64.h
index f9baf9b..8cfad9d 100644
--- a/include/qemu/stats64.h
+++ b/include/qemu/stats64.h
@@ -37,7 +37,7 @@ static inline void stat64_init(Stat64 *s, uint64_t value)

 static inline uint64_t stat64_get(const Stat64 *s)
 {
-    return atomic_read(&s->value);
+    return atomic_read__nocheck(&s->value);
 }

 static inline void stat64_add(Stat64 *s, uint64_t value)
@@ -47,17 +47,17 @@ static inline void stat64_add(Stat64 *s, uint64_t value)

 static inline void stat64_min(Stat64 *s, uint64_t value)
 {
-    uint64_t orig = atomic_read(&s->value);
+    uint64_t orig = atomic_read__nocheck(&s->value);
     while (orig > value) {
-        orig = atomic_cmpxchg(&s->value, orig, value);
+        orig = atomic_cmpxchg__nocheck(&s->value, orig, value);
     }
 }

 static inline void stat64_max(Stat64 *s, uint64_t value)
 {
-    uint64_t orig = atomic_read(&s->value);
+    uint64_t orig = atomic_read__nocheck(&s->value);
     while (orig < value) {
-        orig = atomic_cmpxchg(&s->value, orig, value);
+        orig = atomic_cmpxchg__nocheck(&s->value, orig, value);
     }
 }
 #else


I'll fix this and the long length, and resubmit.

Paolo



reply via email to

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