From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: [patch uq/master 1/2] virtio-pci: wake up iothread on VIRTIO_PCI_QUEUE_NOTIFY Date: Mon, 22 Feb 2010 09:29:15 -0600 Message-ID: <4B82A2CB.3090003@codemonkey.ws> References: <20100222135906.347393434@amt.cnet> <20100222140209.878250600@amt.cnet> <4B8292C4.9070802@redhat.com> <20100222142920.GB18992@amt.cnet> <4B829A02.3040605@redhat.com> <20100222151602.GD18992@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Avi Kivity , kvm@vger.kernel.org, qemu-devel@nongnu.org To: Marcelo Tosatti Return-path: Received: from mail-ww0-f46.google.com ([74.125.82.46]:35961 "EHLO mail-ww0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752955Ab0BVP3X (ORCPT ); Mon, 22 Feb 2010 10:29:23 -0500 Received: by wwf26 with SMTP id 26so441724wwf.19 for ; Mon, 22 Feb 2010 07:29:21 -0800 (PST) In-Reply-To: <20100222151602.GD18992@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: On 02/22/2010 09:16 AM, Marcelo Tosatti wrote: >>> Are you concerned about spurious wakeups? >>> >> Yes. Also, qemu_notify_event() is an undirected notification (wakes >> up all iothreads, and all devices), whereas ->handle_output() is >> directed (wakes up exactly what is needed). >> >> What's the underlying problem? A new input buffer has become >> available, and we need to re-poll the incoming file descriptor? If >> so, that's best done from ->handle_output() (either by waking the >> iothread or calling read() itself and perhaps receiving -EAGAIN). >> > Yes. Sure, perhaps calling read() itself is appropriate, and i see > your point that>handle_output contains more context for a smarter > decision. > > But one can argue thats an improvement on top of a dumb wakeup. > Spurious calls to qemu_notify_event() also make it difficult to tell when it's actually necessary to call qemu_notify_event() vs. when it's just something that doesn't hurt. Regards, Anthony Liguori > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >