From: Ian Campbell Subject: Re: [PATCH V3] Switch from select() to poll() in xenconsoled's IO loop. Date: Mon, 7 Jan 2013 12:16:39 +0000 Message-ID: <1357560999.7989.46.camel@zakaz.uk.xensource.com> References: <1357233257-13918-1-git-send-email-wei.liu2@citrix.com> <1357319859.18503.41.camel@iceland> <1357554023.14291.128.camel@zakaz.uk.xensource.com> <1357560767.10283.15.camel@iceland> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1357560767.10283.15.camel@iceland> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Wei Liu Cc: "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org > > > handle_xs(); > > > > > > for (d = dom_head; d; d = n) { > > > n = d->next; > > > if (d->event_count < RATE_LIMIT_ALLOWANCE) { > > > if (d->xce_handle != NULL && > > > - FD_ISSET(xc_evtchn_fd(d->xce_handle), > > > - &readfds)) > > > + fd_revents(xc_evtchn_fd(d->xce_handle)) & > > > > ... adding some struct pollfd pointers to struct domain (for this and > > master_fd) would remove the need for the fd_to_pollfd lookup array > > altogether. > > > > Yes, this is possible. But my original thought was to make as little > impact to original code as possible, so I didn't touch struct domain and > choose to add extra tracking facilities to make it just work. I think adding a few pointers to struct domain would be less code changed over all since you wouldn't need to create/manage one of the arrays at all. > If we hit poll() bottleneck we can move to libevent or libev, which > requires big surgery on existing code. > > Of course I can do that as well if that suits you. > > > Wei. >