From: Wei Liu Subject: Re: [RFC PATCH V3 05/22] Change MAX_EVTCHNS macro to max_evtchns inline function Date: Thu, 28 Feb 2013 13:59:11 +0000 Message-ID: <1362059951.2109.99.camel@zion.uk.xensource.com> References: <1361975655-22295-1-git-send-email-wei.liu2@citrix.com> <1361975655-22295-6-git-send-email-wei.liu2@citrix.com> <512F4648.3020800@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <512F4648.3020800@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: David Vrabel Cc: "Keir (Xen.org)" , wei.liu2@citrix.com, Ian Campbell , "jbeulich@suse.com" , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On Thu, 2013-02-28 at 11:58 +0000, David Vrabel wrote: > On 27/02/13 14:33, Wei Liu wrote: > > The calculation of max event channels depends on the actual ABI in use. Try to > > avoid gcc-ism macro. > [...] > > +static inline unsigned int max_evtchns(struct domain *d) > > +{ > > + return BITS_PER_EVTCHN_WORD(d) * BITS_PER_EVTCHN_WORD(d); > > +} > > This value doesn't change over the life of the domain. Calculate it once > and save it in a new d->max_evtchns field? > This can change during domain life cycle. But it is doable to save it in d->max_evtchns and change it when necessary. Wei. > David