[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 2/2] main-loop: Use epoll on Linux
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH v3 2/2] main-loop: Use epoll on Linux |
Date: |
Wed, 05 Nov 2014 11:53:23 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 |
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 in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Qemu-devel] [PATCH v3 2/2] main-loop: Use epoll on Linux,
Paolo Bonzini <=