Received: from eggs.gnu.org ([2001:4830:134:3::10]:40855) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VlJYI-0007cK-9N for qemu-devel@nongnu.org; Tue, 26 Nov 2013 09:23:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VlJYC-0006AC-A5 for qemu-devel@nongnu.org; Tue, 26 Nov 2013 09:23:46 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45677) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VlJYC-000693-2E for qemu-devel@nongnu.org; Tue, 26 Nov 2013 09:23:40 -0500 Date: Tue, 26 Nov 2013 22:23:36 +0800 From: Amos Kong Message-ID: <20131126142336.GB29669@amosk.info> References: <1385473433-15844-1-git-send-email-akong@redhat.com> <5294A902.5060000@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5294A902.5060000@redhat.com> Subject: Re: [Qemu-devel] [PATCH] virtio-rng: correct the default limit rate List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: amit.shah@redhat.com, qemu-devel@nongnu.org, anthony@codemonkey.ws On Tue, Nov 26, 2013 at 02:58:26PM +0100, Paolo Bonzini wrote: > Il 26/11/2013 14:43, Amos Kong ha scritto: > > /* Set a default rate limit of 2^47 bytes per minute or roughly 2TB/s. If > > * you have an entropy source capable of generating more entropy than this > > * and you can pass it through via virtio-rng, then hats off to you. Until > > * then, this is unlimited for all practical purposes. > > */ > > > > But the current rate is (INT64_MAX) bytes per (1 << 16) ms, it's 128,000 TB/s > > You are changing: > > * max-bytes from 2^63 to 2^47 > > * period from 65536 to 60000 > > For a user, changing only period would have no effect, the limit rate > would remain effectively infinite. Changing max-bytes would give a 7% > higher rate after your patch. The rate will be effected when period OR max-bytes is changed. Before patch (as documenet described): 2^47 / 65536 = 1.953125 TB/s Applied patch: 2^47 / 600,000 = 2.1328125 TB/s (2.1328125 - 1.953125) / 1.953125 = 0.092 It increased 9.2%, as you said, not a big deal. > Not a big deal, and max-bytes is easier to explain after your patch > (bytes/minute) than before (bytes/65536ms). > > Reviewed-by: Paolo Bonzini Thanks for the quick feedback. Amos