From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60689) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7Kpp-00023l-0m for qemu-devel@nongnu.org; Tue, 23 Jun 2015 05:49:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z7Kpl-0004Xy-RC for qemu-devel@nongnu.org; Tue, 23 Jun 2015 05:49:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38488) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7Kpl-0004Xr-LW for qemu-devel@nongnu.org; Tue, 23 Jun 2015 05:49:37 -0400 Message-ID: <55892BAD.7050405@redhat.com> Date: Tue, 23 Jun 2015 11:49:33 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1434646046-27150-1-git-send-email-pbonzini@redhat.com> <1434646046-27150-7-git-send-email-pbonzini@redhat.com> <20150623092620.GA5798@ad.nay.redhat.com> <55892707.4040103@redhat.com> <20150623094550.GA10697@ad.nay.redhat.com> In-Reply-To: <20150623094550.GA10697@ad.nay.redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 6/9] kvm: First step to push iothread lock out of inner run loop List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: jan.kiszka@siemens.com, qemu-devel@nongnu.org On 23/06/2015 11:45, Fam Zheng wrote: >>> > > break; >>> > > case KVM_EXIT_SYSTEM_EVENT: >>> > > switch (run->system_event.type) { >>> > > case KVM_SYSTEM_EVENT_SHUTDOWN: >>> > > * qemu_system_shutdown_request(); >>> > > ret = EXCP_INTERRUPT; >>> > > break; >>> > > case KVM_SYSTEM_EVENT_RESET: >>> > > * qemu_system_reset_request(); >> > >> > These two are thread-safe. > But above you add lock/unlock around the qemu_system_reset_request() under > KVM_EXIT_SHUTDOWN. What's different? That's unnecessary. Also, just below this switch there's another call to kvm_arch_handle_exit that should be wrapped by lock/unlock (it works anyway because no one handles KVM_EXIT_SYSTEM_EVENT in kvm_arch_handle_exit, but it's not clean). Paolo