* [Qemu-devel] [PATCH 0/2 v2] virtio-rng: Avoid uncessary timer trigger to bump up quota value
@ 2015-07-14 7:34 Pankaj Gupta
0 siblings, 0 replies; only message in thread
From: Pankaj Gupta @ 2015-07-14 7:34 UTC (permalink / raw)
To: qemu-devel; +Cc: amit.shah, Pankaj Gupta, mst
Timer was added in virtio-rng to rate limit the
entropy. It used to trigger at regular intervals to
bump up the quota value. The value of quota and timer
is used to ensure single guest should not use up all the
entropy from the host.
This resulted in triggering of timer even when quota
is not exhausted at all and resulting in extra processing.
This series has two patches:
patch1 : Bump up quota value only when guest requests entropy.
patch2 : Serve pending request if any after timer bumps up quota.
Changes from v1:
Amit Shah :
Serve pending request if any after timer bumps up quota.
Add testing details.
I tested this with '/dev/urandom' at host side. Below are the details:
* Quota+timer specified on command line,
Ran in Guest 'dd if=/dev/hwrng of=/dev/null'
- Quota (4096 bytes), Time slice (1000 ms)
48152 bytes (49 KB) copied, 12.0005 s, 4.1 kB/s
48640 bytes (49 KB) copied, 12.0014 s, 4.1 kB/s
- Quota (8192), Time slice (1000 ms)
65536 bytes (66 KB) copied, 8.00088 s, 8.2 kB/s
146944 bytes (147 KB)copied, 18.0021 s, 8.2 kB/s
- No quota/timer specified on command line, takes default values.
Quota (INT64_MAX), Time slice(65536 ms)
8050688 bytes (8.1 MB) copied, 93.1198 s, 86.5 kB/s
35568128 bytes (36 MB) copied, 408.823 s, 87.0 kB/s
hw/virtio/virtio-rng.c | 51 +++++++++++++++++++++++++----------------
include/hw/virtio/virtio-rng.h | 1
2 files changed, 33 insertions(+), 19 deletions(-)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-07-14 7:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-14 7:34 [Qemu-devel] [PATCH 0/2 v2] virtio-rng: Avoid uncessary timer trigger to bump up quota value Pankaj Gupta
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).