qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: Fam Zheng <famz@redhat.com>
Cc: kwolf@redhat.com, Paolo Bonzini <pbonzini@redhat.com>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] main-loop: Use epoll on Linux
Date: Mon, 29 Sep 2014 11:28:21 +0100	[thread overview]
Message-ID: <20140929102821.GC28435@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <1411968389-7353-1-git-send-email-famz@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 664 bytes --]

On Mon, Sep 29, 2014 at 01:26:29PM +0800, Fam Zheng wrote:
> +int qemu_epoll(GPollFD *fds, guint nfds, int64_t timeout)
> +{
> +    /* A copy of last fd array, used to skip epoll_prepare when nothing
> +     * changed. */
> +    static GPollFD *last_fds;
> +    static guint last_nfds;
> +    /* An array of fds that failed epoll_ctl and fall back to ppoll. Rare case
> +     * too.  */
> +    static GPollFD *g_poll_fds;
> +    static guint g_poll_nfds;
> +    static int *g_poll_fd_idx;
> +    static int epollfd = -1;

These static variables will suffer from race conditions since IOThread
AioContext also calls qemu_poll_ns() when dataplane is active.

Stefan

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

  parent reply	other threads:[~2014-09-29 10:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-29  5:26 [Qemu-devel] [PATCH] main-loop: Use epoll on Linux Fam Zheng
2014-09-29  9:17 ` Fam Zheng
2014-09-29 10:28 ` Stefan Hajnoczi [this message]
2014-09-30  2:51   ` Fam Zheng
2014-09-29 10:29 ` 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=20140929102821.GC28435@stefanha-thinkpad.redhat.com \
    --to=stefanha@redhat.com \
    --cc=famz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@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 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).