From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O6pHx-00081C-T5 for qemu-devel@nongnu.org; Tue, 27 Apr 2010 14:13:41 -0400 Received: from [140.186.70.92] (port=42480 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O6pHw-0007z0-8h for qemu-devel@nongnu.org; Tue, 27 Apr 2010 14:13:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O6pHu-0002rf-AO for qemu-devel@nongnu.org; Tue, 27 Apr 2010 14:13:40 -0400 Received: from mail-qy0-f188.google.com ([209.85.221.188]:55622) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O6pHu-0002rU-4F for qemu-devel@nongnu.org; Tue, 27 Apr 2010 14:13:38 -0400 Received: by qyk26 with SMTP id 26so7376272qyk.19 for ; Tue, 27 Apr 2010 11:13:37 -0700 (PDT) Message-ID: <4BD72949.2070002@codemonkey.ws> Date: Tue, 27 Apr 2010 13:13:29 -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> <20100427175835.GA28137@amt.cnet> In-Reply-To: <20100427175835.GA28137@amt.cnet> 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: Marcelo Tosatti Cc: Amit Shah , qemu list , Juan Quintela On 04/27/2010 12:58 PM, Marcelo Tosatti wrote: > On Tue, Apr 27, 2010 at 12:41:27PM -0500, 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. >> > We discussed this on the following thread: > > http://www.mail-archive.com/kvm@vger.kernel.org/msg29249.html > I don't think there was ever an adequate explanation of exactly what was happening. My suspicion is that the real problem is due to the can_read() handlers whereas it's necessary to invoke the main loop for can_read() to be executed again to cause the event to be polled. The better solution though is to not use the can_read() handler and instead explicitly register and deregister the read callbacks. qemu_set_fd_handler() would require a notify call but that makes sense. I think this is a good justification for removing uses of qemu_set_fd_handler2(). Regards, Anthony Liguori