From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:53635) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRiJu-0006BM-TR for qemu-devel@nongnu.org; Fri, 26 Oct 2012 07:43:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TRiJp-0006gT-Ty for qemu-devel@nongnu.org; Fri, 26 Oct 2012 07:43:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35686) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRiJp-0006gP-M6 for qemu-devel@nongnu.org; Fri, 26 Oct 2012 07:43:17 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q9QBhHFF028700 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 26 Oct 2012 07:43:17 -0400 From: Juan Quintela In-Reply-To: <507FBF24.8060100@redhat.com> (Paolo Bonzini's message of "Thu, 18 Oct 2012 10:34:44 +0200") References: <1350545426-23172-1-git-send-email-quintela@redhat.com> <1350545426-23172-22-git-send-email-quintela@redhat.com> <507FBF24.8060100@redhat.com> Date: Fri, 26 Oct 2012 13:43:14 +0200 Message-ID: <87mwz9xxv1.fsf@elfo.mitica> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 21/30] migration: move exit condition to migration thread Reply-To: quintela@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org Paolo Bonzini wrote: > Il 18/10/2012 09:30, Juan Quintela ha scritto: >> - if (s->migration_state->complete) { >> + qemu_mutex_lock_iothread(); > > So, was it a bug that we were accessing ->complete without the BQL? > >> + if (m->state != MIG_STATE_ACTIVE) { >> + DPRINTF("put_ready returning because of non-active state\n"); > > The contents of the debug message obsolete. Besides, I would just put > the two branches in the same "if (m->state != MIG_STATE_ACTIVE || > m->complete)". BQL is not needed. Complete is only used by the migration thread. but maintaing it outside of the iothread lock, makes locking even more complicated. > >> + qemu_mutex_unlock_iothread(); >> break; >> } >> + if (m->complete) { >> + qemu_mutex_unlock_iothread(); >> + break; >> + } >> + qemu_mutex_unlock_iothread(); >> + > > Paolo