qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC PATCH 17/26] replay: push replay_mutex_lock up the


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [RFC PATCH 17/26] replay: push replay_mutex_lock up the call tree
Date: Thu, 2 Nov 2017 12:56:36 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0

On 31/10/2017 12:26, Pavel Dovgalyuk wrote:
> 
> +
>      if (timeout) {
>          spin_counter = 0;
> -        qemu_mutex_unlock_iothread();

This was done on purpose because it improved performance.  It's probably
pointless now that TCG runs outside the iothread, but it should be a
separate patch.

>      } else {
>          spin_counter++;
>      }
> +    qemu_mutex_unlock_iothread();
> +
> +    if (replay_mode != REPLAY_MODE_NONE) {
> +        replay_mutex_unlock();
> +    }

This is quite ugly.  Perhaps you can push the "if" down inside the
functions?

Paolo

>      ret = qemu_poll_ns((GPollFD *)gpollfds->data, gpollfds->len, timeout);
>  
> -    if (timeout) {
> -        qemu_mutex_lock_iothread();
> +    if (replay_mode != REPLAY_MODE_NONE) {
> +        replay_mutex_lock();
>      }
>  
> +    qemu_mutex_lock_iothread();
> +




reply via email to

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