From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JkjGA-00025V-9N for qemu-devel@nongnu.org; Sat, 12 Apr 2008 13:11:26 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JkjG9-00024F-IL for qemu-devel@nongnu.org; Sat, 12 Apr 2008 13:11:25 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JkjG9-000248-EN for qemu-devel@nongnu.org; Sat, 12 Apr 2008 13:11:25 -0400 Received: from fmmailgate02.web.de ([217.72.192.227]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JkjG8-0004ND-UJ for qemu-devel@nongnu.org; Sat, 12 Apr 2008 13:11:25 -0400 Message-ID: <4800ED38.1080003@web.de> Date: Sat, 12 Apr 2008 19:11:20 +0200 From: Jan Kiszka MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] 8250: more realistic TX-done IRQ rate References: <4800CDAE.3090606@web.de> <200804121748.06132.paul@codesourcery.com> In-Reply-To: <200804121748.06132.paul@codesourcery.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig37A7CE65C7EA9D47AF0D121F" Sender: jan.kiszka@web.de Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paul Brook Cc: qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig37A7CE65C7EA9D47AF0D121F Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Paul Brook wrote: > On Saturday 12 April 2008, Jan Kiszka wrote: >> The 8250 UART emulation currently raises a TX-done IRQ immediately whe= n the >> guest writes out some character. This is problematic for guests like L= inux >> which may flush its output buffer in a loop from IRQ context, because = they >> may then enter a tight loop with IRQs disabled. In fact, Linux breaks = out >> of this loop after some iterations and issue the well-known [1] "too m= uch >> work for irq..." warning. And in case the console output is on the ver= y >> same serial port, the console output is utterly corrupted. >=20 > Please see previous threads on this topic. Some keyword or reference at hand? I did try hpa's patch which was also=20 posted here, but his fix didn't work in my case (some ARM board=20 emulation on recent x86-64 Linux host). >=20 >> Patch below addresses the issue by delaying the TX-done IRQ more >> realistically, ie. according to the currently set baudrate. >=20 > Unless the serial baud rate is extremely low (<1kbaud) this isn't going= to=20 > work with any sort of reliability. You have to fix this in a way that = doesn't > require high resolution realtime response. OK, having no highres clock underneath may cause much heavier delays=20 with this patch than desired or acceptable. I guess I have to think=20 about some accumulative approach that throttles every n characters for a = few miliseconds. Even if that would mean delaying, e.g., 10 ms due to a=20 slow host with tick-based timing (thus about 100 characters @115k), that = should still be fine to address the original issue. > I'd also expect you to have the same problem with the RX queue. If you = don't=20 > it's a bug elsewhere in qemu. >=20 >> + qemu_mod_timer(s->tx_timer, 1000 / (11520 / s->divider));= >=20 > This looks bogus. I think you're a few orders of magnitude out in your = timing=20 > calculations. As mentioned above, in practice you unlikely to get anyw= here > near the necessary realtime performance out of qemu. That depends. Current Linux distros typically have=20 CONFIG_HIGH_RES_TIMERS enabled. But, of course, not many OSes QEMU works = on have such support at all, and even Linux may decided to work without=20 it for various reasons. Thanks, Jan --------------enig37A7CE65C7EA9D47AF0D121F Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4-svn0 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iD8DBQFIAO08niDOoMHTA+kRAoPaAJ9FzpLfTvAG3viX+ibQlt9ZmbrR4QCdEgdr PDPYTJ0c1hW8sVk0KMj+8WU= =tzpF -----END PGP SIGNATURE----- --------------enig37A7CE65C7EA9D47AF0D121F--