From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O77HK-0002gj-2n for qemu-devel@nongnu.org; Wed, 28 Apr 2010 09:26:14 -0400 Received: from [140.186.70.92] (port=40247 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O77HI-0002gE-Gx for qemu-devel@nongnu.org; Wed, 28 Apr 2010 09:26:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O77HD-0002Tr-1U for qemu-devel@nongnu.org; Wed, 28 Apr 2010 09:26:12 -0400 Received: from mail-pv0-f173.google.com ([74.125.83.173]:32995) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O77HC-0002T5-Sc for qemu-devel@nongnu.org; Wed, 28 Apr 2010 09:26:06 -0400 Received: by pvh11 with SMTP id 11so1106711pvh.4 for ; Wed, 28 Apr 2010 06:26:05 -0700 (PDT) Message-ID: <4BD83767.7040806@codemonkey.ws> Date: Wed, 28 Apr 2010 08:25:59 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <1272371652-23087-11-git-send-email-amit.shah@redhat.com> <1272371652-23087-12-git-send-email-amit.shah@redhat.com> <1272371652-23087-13-git-send-email-amit.shah@redhat.com> <1272371652-23087-14-git-send-email-amit.shah@redhat.com> <1272371652-23087-15-git-send-email-amit.shah@redhat.com> <1272371652-23087-16-git-send-email-amit.shah@redhat.com> <1272371652-23087-17-git-send-email-amit.shah@redhat.com> <1272371652-23087-18-git-send-email-amit.shah@redhat.com> <1272371652-23087-19-git-send-email-amit.shah@redhat.com> <4BD721C7.8010102@codemonkey.ws> <20100428072921.GT27314@amit-x200.redhat.com> In-Reply-To: <20100428072921.GT27314@amit-x200.redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH v6 18/18] virtio-serial-bus: wake up iothread upon guest read notification List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amit Shah Cc: Marcelo Tosatti , qemu list , Juan Quintela On 04/28/2010 02:29 AM, Amit Shah wrote: > On (Tue) Apr 27 2010 [12:41:27], Anthony Liguori wrote: > >> On 04/27/2010 07:34 AM, Amit Shah wrote: >> >>> From: Marcelo Tosatti >>> >>> Wake up iothread when buffers are consumed. >>> >>> Signed-off-by: Marcelo Tosatti >>> Signed-off-by: Amit Shah >>> >>> >> What's the race here? This looks very odd to me. >> > When the guest indicates it has added buffers to the vq, the iothread > can then start consuming them. Without this notification, the iothread > only polls for free buffers when it times out or gets woken up > otherwise. > When you say, polls for free buffers, what do you mean by that? You mean, there's a can_read() somewhere that checks for free buffers? I think switching to qemu_set_fd_handler() would be a better solution. Regards, Anthony Liguori > Other virtio devices do it similarly as well. > > Amit >