qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Amos Kong <1253563@bugs.launchpad.net>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [Bug 1253563] [NEW] bad performance with rng-egd backend
Date: Thu, 21 Nov 2013 09:24:11 -0000	[thread overview]
Message-ID: <20131121092412.27241.16050.malonedeb@gac.canonical.com> (raw)
In-Reply-To: 20131121092412.27241.16050.malonedeb@gac.canonical.com

Public bug reported:


1. create listen socket
# cat /dev/random | nc -l localhost 1024

2. start vm with rng-egd backend

./x86_64-softmmu/qemu-system-x86_64 --enable-kvm -mon chardev=qmp,mode=control,pretty=on -chardev socket,id=qmp,host=localhost,port=1234,server,nowait -m 2000 -device virtio-net-pci,netdev=h1,id=vnet0 -netdev tap,id=h1 -vnc :0 -drive file=/images/RHEL-64-virtio.qcow2 \
-chardev socket,host=localhost,port=1024,id=chr0 \
-object rng-egd,chardev=chr0,id=rng0 \
-device virtio-rng-pci,rng=rng0,max-bytes=1024000,period=1000

(guest) # dd if=/dev/hwrng of=/dev/null

note: cancelling dd process by Ctrl+c, it will return the read speed.

Problem:   the speed is around 1k/s

===================

If I use rng-random backend (filename=/dev/random), the speed is about
350k/s).

It seems that when the request entry is added to the list, we don't read the data from queue list immediately.
The chr_read() is delayed, the virtio_notify() is delayed.  the next request will also be delayed. It effects the speed.

I tried to change rng_egd_chr_can_read() always returns 1,  the speed is
improved to (about 400k/s)

Problem: we can't poll the content in time currently


Any thoughts?

Thanks, Amos

** Affects: qemu
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1253563

Title:
  bad performance with rng-egd backend

Status in QEMU:
  New

Bug description:
  
  1. create listen socket
  # cat /dev/random | nc -l localhost 1024

  2. start vm with rng-egd backend

  ./x86_64-softmmu/qemu-system-x86_64 --enable-kvm -mon chardev=qmp,mode=control,pretty=on -chardev socket,id=qmp,host=localhost,port=1234,server,nowait -m 2000 -device virtio-net-pci,netdev=h1,id=vnet0 -netdev tap,id=h1 -vnc :0 -drive file=/images/RHEL-64-virtio.qcow2 \
  -chardev socket,host=localhost,port=1024,id=chr0 \
  -object rng-egd,chardev=chr0,id=rng0 \
  -device virtio-rng-pci,rng=rng0,max-bytes=1024000,period=1000

  (guest) # dd if=/dev/hwrng of=/dev/null

  note: cancelling dd process by Ctrl+c, it will return the read speed.

  Problem:   the speed is around 1k/s

  ===================

  If I use rng-random backend (filename=/dev/random), the speed is about
  350k/s).

  It seems that when the request entry is added to the list, we don't read the data from queue list immediately.
  The chr_read() is delayed, the virtio_notify() is delayed.  the next request will also be delayed. It effects the speed.

  I tried to change rng_egd_chr_can_read() always returns 1,  the speed
  is improved to (about 400k/s)

  Problem: we can't poll the content in time currently

  
  Any thoughts?

  Thanks, Amos

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1253563/+subscriptions

       reply	other threads:[~2013-11-21  9:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-21  9:24 Amos Kong [this message]
2013-11-21 11:01 ` [Qemu-devel] [Bug 1253563] [NEW] bad performance with rng-egd backend Launchpad Bug Tracker
2013-11-26 15:57 ` Amos Kong
2020-08-07 10:05 ` [Bug 1253563] " Thomas Huth
2020-08-19  8:07 ` Amos Jianjun Kong
2020-10-19  4:17 ` Launchpad Bug Tracker

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=20131121092412.27241.16050.malonedeb@gac.canonical.com \
    --to=1253563@bugs.launchpad.net \
    --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).