From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39307) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPFui-0000zz-1B for qemu-devel@nongnu.org; Tue, 11 Aug 2015 16:12:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZPFue-0002Iq-Qv for qemu-devel@nongnu.org; Tue, 11 Aug 2015 16:12:47 -0400 Received: from mail-wi0-f171.google.com ([209.85.212.171]:34281) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPFue-0002IW-LR for qemu-devel@nongnu.org; Tue, 11 Aug 2015 16:12:44 -0400 Received: by wicne3 with SMTP id ne3so191690319wic.1 for ; Tue, 11 Aug 2015 13:12:43 -0700 (PDT) References: <1439220437-23957-1-git-send-email-fred.konrad@greensocs.com> <1439220437-23957-10-git-send-email-fred.konrad@greensocs.com> <55C8CE36.1070208@redhat.com> From: Alex =?utf-8?Q?Benn=C3=A9e?= In-reply-to: <55C8CE36.1070208@redhat.com> Date: Tue, 11 Aug 2015 21:12:41 +0100 Message-ID: <8737zph9dy.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [RFC PATCH V7 09/19] Drop global lock during TCG code execution List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: mttcg@greensocs.com, mark.burton@greensocs.com, a.rigo@virtualopensystems.com, qemu-devel@nongnu.org, guillaume.delbergue@greensocs.com, fred.konrad@greensocs.com Paolo Bonzini writes: > On 10/08/2015 17:27, fred.konrad@greensocs.com 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