From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LvHQA-0003vG-IL for qemu-devel@nongnu.org; Sat, 18 Apr 2009 16:45:54 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LvHQ5-0003ta-Am for qemu-devel@nongnu.org; Sat, 18 Apr 2009 16:45:53 -0400 Received: from [199.232.76.173] (port=41021 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LvHQ5-0003tT-2I for qemu-devel@nongnu.org; Sat, 18 Apr 2009 16:45:49 -0400 Received: from mx2.redhat.com ([66.187.237.31]:46075) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LvHQ4-0000b3-Kh for qemu-devel@nongnu.org; Sat, 18 Apr 2009 16:45:48 -0400 Date: Sat, 18 Apr 2009 17:45:24 -0300 From: Marcelo Tosatti Message-ID: <20090418204524.GA16311@amt.cnet> References: <20090407195126.467365249@localhost.localdomain> <20090407195443.121795529@localhost.localdomain> <49E88C9B.2050205@us.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <49E88C9B.2050205@us.ibm.com> Subject: [Qemu-devel] Re: [patch 05/11] qemu: separate thread for io Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: "qemu-devel@nongnu.org" On Fri, Apr 17, 2009 at 09:05:15AM -0500, Anthony Liguori wrote: > #ifndef CONFIG_IO_THREAD, doesn't main_loop_break need to do cpu_interrupt? Yes, also about the previous comments. Will be fixed by bisectable series as suggested. >> +static void qemu_wait_io_event(CPUState *env, int timeout) >> +{ >> + if (timeout) >> + while (!tcg_has_work(env)) >> + qemu_cond_timedwait(&halt_cond, &qemu_global_mutex, timeout); >> > > What's the point of having a timeout? I don't think there's much other than honouring the behaviour of the non-io-thread version. Now, I believe icount breaks if you don't honour it. >> + >> +static void qemu_signal_lock(unsigned int msecs) >> +{ >> + qemu_mutex_lock(&qemu_fair_mutex); >> + >> + while (qemu_mutex_trylock(&qemu_global_mutex)) { >> + qemu_thread_signal(&cpus_thread, SIGUSR1); >> + if (!qemu_mutex_timedlock(&qemu_global_mutex, msecs)) >> + break; >> + } >> + qemu_mutex_unlock(&qemu_fair_mutex); >> +} >> + >> > > Now's a good time to attempt to move a lot of the main loop stuff into a > separate file. We can do it after the IO thread series or you can make > it part of the IO thread series. Sure.