From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NvBeo-0006mV-Jq for qemu-devel@nongnu.org; Fri, 26 Mar 2010 11:41:10 -0400 Received: from [140.186.70.92] (port=60396 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NvBej-0006d8-HS for qemu-devel@nongnu.org; Fri, 26 Mar 2010 11:41:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NvBeh-0002jt-Tn for qemu-devel@nongnu.org; Fri, 26 Mar 2010 11:41:05 -0400 Received: from e1.ny.us.ibm.com ([32.97.182.141]:59490) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NvBeh-0002jU-P6 for qemu-devel@nongnu.org; Fri, 26 Mar 2010 11:41:03 -0400 Received: from d01relay07.pok.ibm.com (d01relay07.pok.ibm.com [9.56.227.147]) by e1.ny.us.ibm.com (8.14.3/8.13.1) with ESMTP id o2QFaTjK001462 for ; Fri, 26 Mar 2010 11:36:29 -0400 Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by d01relay07.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o2QFeroB1781882 for ; Fri, 26 Mar 2010 11:40:54 -0400 Received: from d01av01.pok.ibm.com (loopback [127.0.0.1]) by d01av01.pok.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id o2QFerL2018627 for ; Fri, 26 Mar 2010 11:40:53 -0400 Message-ID: <4BACD582.2070006@linux.vnet.ibm.com> Date: Fri, 26 Mar 2010 10:40:50 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [patch 1/2] Pass QEMUIOWorker to qemu_notify_event References: <20100325134715.354365213@amt.cnet> <201003252106.01194.paul@codesourcery.com> <20100326035558.GA20616@amt.cnet> <201003261523.03617.paul@codesourcery.com> In-Reply-To: <201003261523.03617.paul@codesourcery.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paul Brook Cc: amit.shah@redhat.com, Marcelo Tosatti , qemu-devel@nongnu.org On 03/26/2010 10:23 AM, Paul Brook wrote: >> On Thu, Mar 25, 2010 at 09:06:00PM +0000, Paul Brook wrote: >> >>>> /* Force QEMU to process pending events */ >>>> -void qemu_notify_event(void); >>>> +void qemu_notify_event(QEMUIOWorker *worker); >>>> >>>> static void handle_input(VirtIODevice *vdev, VirtQueue *vq) >>>> { >>>> + qemu_notify_event(main_io_worker); >>>> } >>>> >>> This feels completely wrong. >>> >>> Devices shouldn't know or care about implementation details like this. >>> How is a device supposed to know which worker it should be waking up? >>> >> Its not. It could use qemu_notify_event(DeviceInfo->worker), and have no >> knowledge of the internals. >> > In that case I think you're abusing this API. > > I'm very wary of introducing random bits of code that allegedly allow future > use of threads. Exploiting thread level parallelism is a hard problem that > needs proper design. A such I object to this patch, and think we first need > to decide what form of concurrency model we want to use in QEMU. > I agree. There's a lot of context missing from a proposal like this. Regards, Anthony Liguori > Paul > > >