From: Ian Campbell Subject: Re: [PATCH V6] Switch from select() to poll() in xenconsoled's IO loop Date: Wed, 9 Jan 2013 11:02:22 +0000 Message-ID: <1357729342.7989.226.camel@zakaz.uk.xensource.com> References: <1357725038-3949-1-git-send-email-wei.liu2@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1357725038-3949-1-git-send-email-wei.liu2@citrix.com> 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: Mats Petersson , Ian Jackson , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On Wed, 2013-01-09 at 09:50 +0000, Wei Liu wrote: > In Linux select() typically supports up to 1024 file descriptors. This can be > a problem when user tries to boot up many guests. Switching to poll() has > minimum impact on existing code and has better scalibility. > > pollfd array is dynamically allocated / reallocated. If the array fails to > expand, we just ignore the incoming fd. > > Change from V2: > * remove unnecessary malloc in initialize_pollfd_arrays > * use ROUND_UP to get new size of arrays > > Change from V3: > * remove initialize and destroy function for array > * embedded tracking structure in struct domain, eliminate fd_to_pollfd > > Change from V4: > * make xs_pollfd local to io.c > * add back the 5 ms fuzz > * handle POLLERR and POLLHUP > * treat POLLPRI as error if set in revents > * abort if xenconsoled's own fds get screwed > * handle broken tty if tty's fds get screwed > > Change from V5: > * make some handles local to handle_io The code now resets some of these to -1/NULL on exit from handle_io, which isn't really necessary but I'm not to bothered about that. > * remove redundant xc interface > > Signed-off-by: Wei Liu Acked-by: Ian Campbell