qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 08/13] qemu-thread: optimize spin_lock for un


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH v2 08/13] qemu-thread: optimize spin_lock for uncontended locks
Date: Fri, 8 Apr 2016 11:40:25 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1

On 04/07/2016 10:32 AM, Emilio G. Cota wrote:
>  static inline void qemu_spin_lock(QemuSpin *spin)
>  {
> -    do {
> +    while (atomic_xchg(&spin->value, true)) {
>          while (atomic_read(&spin->value)) {
>              cpu_relax();
>          }
> -    } while (atomic_xchg(&spin->value, true));
> +    }
>  }

And merge this one as well, please.  It's a good improvement, but there's
little point to keeping these separate.


r~



reply via email to

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