qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] (no subject)
@ 2015-07-14  7:33 Pankaj Gupta
  2015-07-14  7:33 ` [Qemu-devel] [PATCH 1/2 v2] virtio-rng: Bump up quota value only when guest requests entropy Pankaj Gupta
  2015-07-14  7:33 ` [Qemu-devel] [PATCH 2/2 v2] virtio-rng: Serve pending request if any after timer bumps up quota Pankaj Gupta
  0 siblings, 2 replies; 8+ messages in thread
From: Pankaj Gupta @ 2015-07-14  7:33 UTC (permalink / raw)
  To: qemu-devel; +Cc: amit.shah, Pankaj Gupta, mst

Subject: [PATCH 0/2 v2] virtio-rng: Avoid uncessary timer trigger to bump up quota value 

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] 8+ messages in thread

end of thread, other threads:[~2015-07-15  9:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-14  7:33 [Qemu-devel] (no subject) Pankaj Gupta
2015-07-14  7:33 ` [Qemu-devel] [PATCH 1/2 v2] virtio-rng: Bump up quota value only when guest requests entropy Pankaj Gupta
2015-07-15  6:41   ` Amit Shah
2015-07-14  7:33 ` [Qemu-devel] [PATCH 2/2 v2] virtio-rng: Serve pending request if any after timer bumps up quota Pankaj Gupta
2015-07-15  6:39   ` Amit Shah
2015-07-15  7:05     ` Pankaj Gupta
2015-07-15  8:15       ` Amit Shah
2015-07-15  9:27         ` 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).