From: Paolo Bonzini <pbonzini@redhat.com>
To: Fam Zheng <famz@redhat.com>, qemu-devel@nongnu.org
Cc: kwolf@redhat.com, Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v3 2/2] main-loop: Use epoll on Linux
Date: Wed, 05 Nov 2014 11:53:23 +0100 [thread overview]
Message-ID: <545A01A3.3070206@redhat.com> (raw)
In-Reply-To: <1414395048-16006-3-git-send-email-famz@redhat.com>
On 27/10/2014 08:30, Fam Zheng wrote:
>
> +static int epoll_prepare(int epollfd,
> + GPollFD *fds, guint nfds,
> + GPollFD **g_poll_fds,
> + guint *g_poll_nfds,
> + int **g_poll_fd_idx)
Please pass the QEMUPollContext to epoll_prepare.
> + if (ctx->last_fds) {
> + close(ctx->epollfd);
> + }
> + ctx->epollfd = epoll_create(1);
Please use epoll_create1 with the EPOLL_CLOEXEC flag.
> + if (ctx->epollfd < 0) {
> + perror("epoll_create");
> + abort();
> + }
Interesting. Is it cheaper to do this than to compute a symmetric
difference?
I am worried that the epoll_create fails with EMFILE, and that the
destruction/recreation happens often with networking (which uses
qemu_set_fd_handler2) if you use the right workload.
Paolo
prev parent reply other threads:[~2014-11-05 10:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-27 7:30 [Qemu-devel] [PATCH v3 0/2] main-loop: Use epoll on Linux Fam Zheng
2014-10-27 7:30 ` [Qemu-devel] [PATCH v3 1/2] main-loop: Introduce context parameter for qemu_poll_ns Fam Zheng
2014-10-27 7:30 ` [Qemu-devel] [PATCH v3 2/2] main-loop: Use epoll on Linux Fam Zheng
2014-11-05 10:53 ` Paolo Bonzini [this message]
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=545A01A3.3070206@redhat.com \
--to=pbonzini@redhat.com \
--cc=famz@redhat.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 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).