From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH v7 07/14] x86: dynamically get/set CBM for a domain Date: Thu, 14 May 2015 11:19:17 +0200 Message-ID: <1431595157.2978.153.camel@citrix.com> References: <1431075415-21917-1-git-send-email-chao.p.peng@linux.intel.com> <1431075415-21917-8-git-send-email-chao.p.peng@linux.intel.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1578051654919804902==" Return-path: In-Reply-To: <1431075415-21917-8-git-send-email-chao.p.peng@linux.intel.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: Chao Peng Cc: keir@xen.org, Ian.Campbell@citrix.com, stefano.stabellini@eu.citrix.com, andrew.cooper3@citrix.com, Ian.Jackson@eu.citrix.com, xen-devel@lists.xen.org, will.auld@intel.com, JBeulich@suse.com, wei.liu2@citrix.com, dgdegra@tycho.nsa.gov List-Id: xen-devel@lists.xenproject.org --===============1578051654919804902== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-LxZMnPAxuUM0W8S+BM2t" --=-LxZMnPAxuUM0W8S+BM2t Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, 2015-05-08 at 16:56 +0800, Chao Peng wrote: > For CAT, COS is maintained in hypervisor only while CBM is exposed to > user space directly to allow getting/setting domain's cache capacity. > For each specified CBM, hypervisor will either use a existed COS which > has the same CBM or allocate a new one if the same CBM is not found. If > the allocation fails because of no enough COS available then error is > returned. The getting/setting are always operated on a specified socket. > For multiple sockets system, the interface may be called several times. >=20 > Signed-off-by: Chao Peng > Reviewed-by: Dario Faggioli Just, one minor thing, only if you end up resending... > diff --git a/xen/arch/x86/psr.c b/xen/arch/x86/psr.c > index 1feb2f6..385807b 100644 > --- a/xen/arch/x86/psr.c > +++ b/xen/arch/x86/psr.c > @@ -49,6 +49,14 @@ static unsigned int opt_cos_max =3D 255; > static uint64_t rmid_mask; > static DEFINE_PER_CPU(struct psr_assoc, psr_assoc); > =20 > +static unsigned int get_socket_cpu(unsigned int socket) > +{ > + if ( socket < nr_sockets ) > + return cpumask_any(socket_to_cpumask[socket]); > + ... What about=20 if ( likely(socket < nr_sockets) ) Regards, Dario --=-LxZMnPAxuUM0W8S+BM2t Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEABECAAYFAlVUaJYACgkQk4XaBE3IOsSpVgCfdKPQI9P+kuXf79O/PxdSgDMK iHsAoIKJcKD9oP5zIU1afw4CA0G5Vshg =Eg5e -----END PGP SIGNATURE----- --=-LxZMnPAxuUM0W8S+BM2t-- --===============1578051654919804902== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============1578051654919804902==--