qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [patch 1/2] Pass QEMUIOWorker to qemu_notify_event


From: Anthony Liguori
Subject: Re: [Qemu-devel] [patch 1/2] Pass QEMUIOWorker to qemu_notify_event
Date: Fri, 26 Mar 2010 10:40:50 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20091209 Fedora/3.0-4.fc12 Lightning/1.0pre Thunderbird/3.0

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







reply via email to

[Prev in Thread] Current Thread [Next in Thread]