From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH] fix reading from character devices Date: Mon, 21 Jan 2008 12:30:25 +0100 Message-ID: <47948251.1030204@siemens.com> References: <47946610.9040001@siemens.com> <47947045.6040106@qumranet.com> <1200912198.3188.6.camel@localhost.localdomain> <479478E6.6030903@qumranet.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Avi Kivity Return-path: In-Reply-To: <479478E6.6030903-atKUWr5tajBWk0Htik3J/w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org Avi Kivity wrote: > Dor Laor wrote: >> On Mon, 2008-01-21 at 12:13 +0200, Avi Kivity wrote: >> >>> Jan Kiszka wrote: >>> >>>> Hi Avi, >>>> >>>> commit "kvm: qemu: consume all pending I/O in I/O loop" >>>> (8ab8bb09f1115b9bf733f885cc92b6c63d83f420) broke reading data bursts >>>> from serial devices (and maybe from other character devices as well) by >>>> guests. Reason: serial devices do input flow control via fd_read_poll, >>>> but qemu now ignores this fact by pushing all data into the virtual >>>> device as soon as it is available. >>>> >>>> Patch below is not really nice (just as the whole internal virtual I/O >>>> interface at the moment, IMHO), but it re-enables the serial ports for >>>> now. >>>> >>>> >>> I'm worried that it will break Dor's hack that speeds up virtio. Dor? >>> >>> >> >> It should be fine. Tap device without my hack has fd_read_poll null and >> I hacked it to have a handler that returns false if virtio is used and >> true otherwise. So Jan's patch should set 'more' to 1 and it will be >> like before. >> >> > > But if virtio is used with this patch, it won't set 'more' to 1. Will > virtio handle it or will throughput drop to be related to whatever > timers we have set up? As long as virtio_net_can_receive returns 1, the loop will keep on feeding also this device. And if it returns 0, I see no reason for ignoring this signal. Anythings else would be, well, weird. However, the current io-polling loop in git urgently needs fixing, or even a redesign. Jan -- Siemens AG, Corporate Technology, CT SE 2 Corporate Competence Center Embedded Linux ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/