qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Pankaj Gupta <pagupta@redhat.com>
To: qemu-devel@nongnu.org
Cc: amit.shah@redhat.com, Pankaj Gupta <pagupta@redhat.com>, mst@redhat.com
Subject: [Qemu-devel] [PATCH 0/2 v2] virtio-rng: Avoid uncessary timer trigger to bump up quota value
Date: Tue, 14 Jul 2015 13:04:54 +0530	[thread overview]
Message-ID: <1436859294-20043-1-git-send-email-pagupta@redhat.com> (raw)

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(-)

                 reply	other threads:[~2015-07-14  7:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1436859294-20043-1-git-send-email-pagupta@redhat.com \
    --to=pagupta@redhat.com \
    --cc=amit.shah@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).