From: Avi Kivity <avi@qumranet.com>
To: Anthony Liguori <aliguori@us.ibm.com>
Cc: kvm-devel@lists.sourceforge.net, Marcelo Tosatti <mtosatti@redhat.com>
Subject: Re: [PATCH] Use pipe() to simulate signalfd() (v2)
Date: Sun, 04 May 2008 12:06:16 +0300 [thread overview]
Message-ID: <481D7C88.1080609@qumranet.com> (raw)
In-Reply-To: <1209757346-15076-1-git-send-email-aliguori@us.ibm.com>
Anthony Liguori wrote:
> This patch reworks the IO thread to use signalfd() instead of sigtimedwait().
> This will eliminate the need to use SIGIO everywhere. In this version of the
> patch, we use signalfd() when it's available. When it isn't available, we
> instead use a pipe() that is written to in each signal handler.
>
> I've tested Windows and Linux guests with SMP without seeing an obvious
> regressions.
>
>
Please split the signalfd() emulation into a separate (preparatory)
patch. Also, we need to detect signalfd() at run time as well as
compile time, since qemu may be compiled on a different machine than it
is run on.
> +/* If we don't have signalfd, we don't mask out the signals we want to receive.
> + * To avoid the signal/select race, we use a pipe() that we write to from the
> + * signal handler. As a consequence, we save off the signal handler to perform
> + * dispatch.
> + */
>
We can keep the signals blocked, but run the signalfd emulation in a
separate thread (where it can dequeue signals using sigwait as an added
bonus). This will reduce the differences between the two modes at the
expense of increased signalfd() emulation complexity, which I think is a
good tradeoff.
We can move signalfd emulation into a separate file in order to improve
readability.
--
error compiling committee.c: too many arguments to function
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
next prev parent reply other threads:[~2008-05-04 9:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-02 19:42 [PATCH] Use pipe() to simulate signalfd() (v2) Anthony Liguori
2008-05-04 9:06 ` Avi Kivity [this message]
2008-05-04 14:21 ` Anthony Liguori
2008-05-04 14:39 ` Avi Kivity
2008-05-04 14:46 ` Anthony Liguori
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=481D7C88.1080609@qumranet.com \
--to=avi@qumranet.com \
--cc=aliguori@us.ibm.com \
--cc=kvm-devel@lists.sourceforge.net \
--cc=mtosatti@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox