From: "Jan Beulich" Subject: Re: [PATCH v13 05/10] x86: dynamically attach/detach QoS monitoring service for a guest Date: Mon, 04 Aug 2014 12:23:56 +0100 Message-ID: <53DF896C0200007800028F25@mail.emea.novell.com> References: <1407118626-76843-1-git-send-email-dongxiao.xu@intel.com> <1407118626-76843-6-git-send-email-dongxiao.xu@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1407118626-76843-6-git-send-email-dongxiao.xu@intel.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Dongxiao Xu Cc: keir@xen.org, Ian.Campbell@citrix.com, stefano.stabellini@eu.citrix.com, George.Dunlap@eu.citrix.com, andrew.cooper3@citrix.com, Ian.Jackson@eu.citrix.com, xen-devel@lists.xen.org, dgdegra@tycho.nsa.gov List-Id: xen-devel@lists.xenproject.org >>> On 04.08.14 at 04:17, wrote: > +/* Called with domain lock held, no pqos specific lock needed */ > +int pqos_monitor_alloc_rmid(struct domain *d) > +{ > + unsigned int rmid; > + > + ASSERT(pqos_monitor_enabled()); > + > + if ( d->arch.pqos_rmid > 0 ) > + return -EEXIST; > + > + for ( rmid = pqosm->rmid_min; rmid <= pqosm->rmid_max; rmid++ ) > + { > + if ( pqosm->rmid_to_dom[rmid] != DOMID_INVALID) > + continue; > + > + pqosm->rmid_to_dom[rmid] = d->domain_id; > + break; > + } > + > + /* No RMID available, assign RMID=0 by default */ > + if ( rmid > pqosm->rmid_max ) > + { > + d->arch.pqos_rmid = 0; > + return -EUSERS; > + } > + else Pointless "else". > + pqosm->rmid_inuse++; This field only ever gets written, and hence is useless up to at least here. Peeking forward I'm also not really certain it is useful at all. Jan