qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH RFC 1/2] rng-egd: improve egd backend performanc


From: Amos Kong
Subject: Re: [Qemu-devel] [PATCH RFC 1/2] rng-egd: improve egd backend performance
Date: Tue, 17 Dec 2013 15:03:50 +0800
User-agent: Mutt/1.5.21 (2010-09-15)

On Tue, Dec 17, 2013 at 11:22:14AM +0530, Amit Shah wrote:
> On (Mon) 16 Dec 2013 [15:19:31], Anthony Liguori wrote:
> > On Mon, Dec 16, 2013 at 8:36 AM, Amit Shah <address@hidden> wrote:
> > > On (Mon) 09 Dec 2013 [22:10:12], Amos Kong wrote:
> > >> Bugzilla: https://bugs.launchpad.net/qemu/+bug/1253563
> > >>
> > >> We have a requests queue to cache the random data, but the second
> > >> will come in when the first request is returned, so we always
> > >> only have one items in the queue. It effects the performance.
> > >>
> > >> This patch changes the IOthread to fill a fixed buffer with
> > >> random data from egd socket, request_entropy() will return
> > >> data to virtio queue if buffer has available data.
> > >>
> > >> (test with a fast source, disguised egd socket)
> > >>  # cat /dev/urandom | nc -l localhost 8003
> > >>  # qemu .. -chardev socket,host=localhost,port=8003,id=chr0 \
> > >>         -object rng-egd,chardev=chr0,id=rng0,buf_size=1024 \
> > >>         -device virtio-rng-pci,rng=rng0
> > >

We have a wiki about about configing egd.
http://fedoraproject.org/wiki/QA:Testcase_Virtualization_VirtioRNG

> > > First thing I can think of is the egd protocol has a length field in
> > > the header, and if that isn't properly filled, the results are bound
> > > to be erratic.

The header setup in rng-egd.c is correct, we can check the debug
output of egd.pl

> > The test is bogus.
> > 
> > egd is a protocol.  You can't just pipe /dev/urandom into it.

In my test host, When I use the egd-socket, it is very slow.
So I use a quick souce /dev/urandom, we ignore the egd protocol
here, it might be wrong.
 
> Can you suggest a way to test this the right way?
 
It seems we should still use egd.pl to setup a daemon socket.
But how to make it very quick? We can't verify the performance
improvement if the source is too slow.

Can we use "--bottomless" option for egd.pl? it will not decrement
entropy count. When I use this option, the speed (without my patches)
is about 13 kB/s.

>               Amit

-- 
                        Amos.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]