Received: from eggs.gnu.org ([2001:4830:134:3::10]:57448) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XYYC4-0005tw-Ru for qemu-devel@nongnu.org; Mon, 29 Sep 2014 06:28:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XYYBy-0005Sk-08 for qemu-devel@nongnu.org; Mon, 29 Sep 2014 06:28:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:8848) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XYYBx-0005Km-Q4 for qemu-devel@nongnu.org; Mon, 29 Sep 2014 06:28:29 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s8TASN5j016964 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Mon, 29 Sep 2014 06:28:24 -0400 Date: Mon, 29 Sep 2014 11:28:21 +0100 From: Stefan Hajnoczi Message-ID: <20140929102821.GC28435@stefanha-thinkpad.redhat.com> References: <1411968389-7353-1-git-send-email-famz@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ZmUaFz6apKcXQszQ" Content-Disposition: inline In-Reply-To: <1411968389-7353-1-git-send-email-famz@redhat.com> Subject: Re: [Qemu-devel] [PATCH] main-loop: Use epoll on Linux List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: kwolf@redhat.com, Paolo Bonzini , qemu-devel@nongnu.org --ZmUaFz6apKcXQszQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 --ZmUaFz6apKcXQszQ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJUKTRFAAoJEJykq7OBq3PIRvMH/jZFpr76xB8aMWEq7oJhbANt mav1/WUYtWdbbx1hC6DLYcfE8R8JOK/hKZVVHM2y737FlWOsbUVZV5Cjs938OaRW PVVxkkr7gV1s1DHmAJVVUpqn57AuvvAEoQgjO0vcGpwebBxrx4dMEN3UEzuIhQwW RNxOEp0JCd6dpkUdgxHTlEjUGhFxtOTZyLJBn8rLEFZe6SWczAmi+eg2qN5TBzeI Uw/JE5TXRIrOsWFf7WLJ2Jg+gB7tKkjaH36jF5HdFn5RYXcj6kWL+Fm70XaNwFoz BbPi5dIaAXKjLCX7AcAWJqrEPnljQh96EJa+kNX9z4b2sk6HgTlo6uDQKY7cGR0= =AziS -----END PGP SIGNATURE----- --ZmUaFz6apKcXQszQ--