All of lore.kernel.org
 help / color / mirror / Atom feed
From: Josh Durgin <josh.durgin@inktank.com>
To: Stefan Hajnoczi <stefanha@redhat.com>, qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] rbd: switch from pipe to QEMUBH completion notification
Date: Fri, 27 Dec 2013 17:07:57 -0800	[thread overview]
Message-ID: <52BE246D.4070704@inktank.com> (raw)
In-Reply-To: <1386257913-13700-1-git-send-email-stefanha@redhat.com>

On 12/05/2013 07:38 AM, Stefan Hajnoczi wrote:
> rbd callbacks are called from non-QEMU threads.  Up until now a pipe was
> used to signal completion back to the QEMU iothread.
>
> The pipe writer code handles EAGAIN using select(2).  The select(2) API
> is not scalable since fd_set size is static.  FD_SET() can write beyond
> the end of fd_set if the file descriptor number is too high.  (QEMU's
> main loop uses poll(2) to avoid this issue with select(2).)
>
> Since the pipe itself is quite clumsy to use and QEMUBH is now
> thread-safe, just schedule a BH from the rbd callback function.  This
> way we can simplify I/O completion in addition to eliminating the
> potential FD_SET() crash when file descriptor numbers become too high.
>
> Crash scenario: QEMU already has 1024 file descriptors open.  Hotplug an
> rbd drive and get the pipe writer to take the select(2) code path.
>
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
> Josh: This patch has not been tested.  I have just compiled it.

Sorry for the delay. This is a great simplification, and it passed my
tests. Thanks!

Reviewed- and Tested-by: Josh Durgin <josh.durgin@inktank.com>

  reply	other threads:[~2013-12-28  1:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-05 15:38 [Qemu-devel] [PATCH] rbd: switch from pipe to QEMUBH completion notification Stefan Hajnoczi
2013-12-28  1:07 ` Josh Durgin [this message]
2014-01-02  3:54 ` Stefan Hajnoczi

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=52BE246D.4070704@inktank.com \
    --to=josh.durgin@inktank.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /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.