qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC PATCH V7 09/19] Drop global lock during TCG code e


From: Alex Bennée
Subject: Re: [Qemu-devel] [RFC PATCH V7 09/19] Drop global lock during TCG code execution
Date: Tue, 11 Aug 2015 21:12:41 +0100

Paolo Bonzini <address@hidden> writes:

> On 10/08/2015 17:27, address@hidden wrote:
>>  void qemu_mutex_lock_iothread(void)
>>  {
>> -    atomic_inc(&iothread_requesting_mutex);
>> -    /* In the simple case there is no need to bump the VCPU thread out of
>> -     * TCG code execution.
>> -     */
>> -    if (!tcg_enabled() || qemu_in_vcpu_thread() ||
>> -        !first_cpu || !first_cpu->thread) {
>> -        qemu_mutex_lock(&qemu_global_mutex);
>> -        atomic_dec(&iothread_requesting_mutex);
>> -    } else {
>> -        if (qemu_mutex_trylock(&qemu_global_mutex)) {
>> -            qemu_cpu_kick_thread(first_cpu);
>> -            qemu_mutex_lock(&qemu_global_mutex);
>> -        }
>> -        atomic_dec(&iothread_requesting_mutex);
>> -        qemu_cond_broadcast(&qemu_io_proceeded_cond);
>> -    }
>> -    iothread_locked = true;
>
> "iothread_locked = true" must be kept.  Otherwise... yay! :)
>

Also if qemu_cond_broadcast(&qemu_io_proceeded_cond) is being dropped
there is no point keeping the guff around in qemu_tcg_wait_io_event.

-- 
Alex Bennée



reply via email to

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