All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amit Shah <amit.shah@redhat.com>
To: Ladi Prosek <lprosek@redhat.com>
Cc: pagupta@redhat.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] rng-random: implement request queue
Date: Wed, 3 Feb 2016 18:06:39 +0530	[thread overview]
Message-ID: <20160203123639.GA20527@grmbl.mre> (raw)
In-Reply-To: <1453465198-11000-1-git-send-email-lprosek@redhat.com>

Hi Ladi,

Adding Pankaj to CC, he too looked at this recently.

On (Fri) 22 Jan 2016 [13:19:58], Ladi Prosek wrote:
> If the guest adds a buffer to the virtio queue while another buffer
> is still pending and hasn't been filled and returned by the rng
> device, rng-random internally discards the pending request, which
> leads to the second buffer getting stuck in the queue. For the guest
> this manifests as delayed completion of reads from virtio-rng, i.e.
> a read is completed only after another read is issued.
> 
> This patch adds an internal queue of requests, analogous to what
> rng-egd uses, to make sure that requests and responses are balanced
> and correctly ordered.

... and this can lead to breaking migration (the queue of requests on
the host needs to be migrated, else the new host will have no idea of
the queue).

I think we should limit the queue size to 1 instead.  Multiple rng
requests should not be common, because if we did have entropy, we'd
just service the guest request and be done with it.  If we haven't
replied to the guest, it just means that the host itself is waiting
for more entropy, or is waiting for the timeout before the guest's
ratelimit is lifted.

So, instead of fixing this using a queue, how about limiting the size
of the vq to have just one element at a time?

Thanks,

		Amit

  reply	other threads:[~2016-02-03 12:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-22 12:19 [Qemu-devel] [PATCH] rng-random: implement request queue Ladi Prosek
2016-02-03 12:36 ` Amit Shah [this message]
2016-02-03 18:02   ` Ladi Prosek
2016-02-03 18:44   ` Paolo Bonzini
2016-02-04  8:53     ` Pankaj Gupta
2016-02-04 17:36       ` Ladi Prosek
2016-02-05  5:31         ` Pankaj Gupta
2016-02-04 17:24     ` Ladi Prosek
2016-02-04 18:07       ` Ladi Prosek
2016-02-05  8:32         ` Paolo Bonzini
2016-03-03  5:05         ` Amit Shah
2016-03-03  9:30           ` Ladi Prosek

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=20160203123639.GA20527@grmbl.mre \
    --to=amit.shah@redhat.com \
    --cc=lprosek@redhat.com \
    --cc=pagupta@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.