qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v5 2/2] migration: Make dirty_bytes_last_sync atomic


From: Juan Quintela
Subject: Re: [PATCH v5 2/2] migration: Make dirty_bytes_last_sync atomic
Date: Thu, 27 Apr 2023 10:40:28 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

Paolo Bonzini <pbonzini@redhat.com> wrote:
> On 4/26/23 22:10, Juan Quintela wrote:
>> Don't use __nocheck() functions.
>
> Doesn't this break on 32-bit platforms?
>
> #if defined(__x86_64__) || defined(__sparc__) || defined(__mips64)
> # define ATOMIC_REG_SIZE  8
> #else
> # define ATOMIC_REG_SIZE  sizeof(void *)
> #endif
>
> #define qatomic_set(ptr, i)  do {                      \
>     qemu_build_assert(sizeof(*ptr) <= ATOMIC_REG_SIZE); \
>     qatomic_set__nocheck(ptr, i);                      \
> } while(0)
>
> So if sizeof(void*) == 4 it would trigger a compile-time assertion.
>
> Paolo

Yeap.

Really I was waiting for stat64_set() that you have just sent, will do
it on top of that.

And yes, I already broke the build with that patch.

Later, Juan.




reply via email to

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