From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KQNL9-0006yd-RF for qemu-devel@nongnu.org; Tue, 05 Aug 2008 10:16:43 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KQNL7-0006wl-Qw for qemu-devel@nongnu.org; Tue, 05 Aug 2008 10:16:43 -0400 Received: from [199.232.76.173] (port=35762 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KQNL7-0006wV-0U for qemu-devel@nongnu.org; Tue, 05 Aug 2008 10:16:41 -0400 Received: from smtp.eu.citrix.com ([62.200.22.115]:60643) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KQNL1-0003CE-I9 for qemu-devel@nongnu.org; Tue, 05 Aug 2008 10:16:36 -0400 Message-ID: <4898610A.7050007@eu.citrix.com> Date: Tue, 05 Aug 2008 15:17:46 +0100 From: Stefano Stabellini MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] upgrading emulated UART to 16550A References: <48985284.9060001@eu.citrix.com> <20080805135738.GC4102@networkno.de> In-Reply-To: <20080805135738.GC4102@networkno.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Thiemo Seufer Cc: Ian Jackson , qemu-devel@nongnu.org Thiemo Seufer wrote: >> +/* Rate limit serial requests so that e.g. grub on a serial console >> + doesn't kill dom0. Simple token bucket. If we get some actual >> + data from the user, instantly refil the bucket. */ >> + >> +/* How long it takes to generate a token, in nanoseconds. */ >> +#define TOKEN_PERIOD 1000000 >> +/* Maximum and initial size of token bucket */ >> +#define TOKENS_MAX 100000 > > This token business probably needs a bit more explanation, at a glance > I didn't figure out what it is meant to do (and why the constants above > are good). > The token bucket was introduced to rate limit serial requests, mainly for performance reasons (grub makes too many requests). However I realize that conceptually it doesn't belong to qemu, so I am going to send another patch soon without the token bucket.