From: Ian Campbell Subject: Re: [PATCH] Switch from select() to poll() in xenconsoled's IO loop Date: Tue, 8 Jan 2013 14:07:14 +0000 Message-ID: <1357654034.7989.188.camel@zakaz.uk.xensource.com> References: <1357645812-25072-1-git-send-email-wei.liu2@citrix.com> <1357649563.13581.19.camel@iceland> <50EC26A6.90405@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <50EC26A6.90405@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: Mats Petersson Cc: Ian Jackson , Wei Liu , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On Tue, 2013-01-08 at 14:01 +0000, Mats Petersson wrote: > >> +struct pollfd *xs_pollfd; > Why is this not "static"? > >> +static struct pollfd *fds; > >> +static unsigned int current_array_size; > >> +static unsigned int nr_fds; > There seems to be no particular reason why these variables are here, and > the other ones up the top of the file. For example xce_handle is not > used "above" here, but it's declared at the top of the file. I think > keeping all variables together makes more sense than scattering them around. I'd prefer if those which can be were local to the handle_io function and not global at all. I think this includes both xs_pollfd and xce_pollfd. I think it also includes the existing xce_handle and log_hv_evtchn. Ian.