On Thu, May 14, 2015 at 11:19:17AM +0200, Dario Faggioli wrote: > 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. > > > > Signed-off-by: Chao Peng <chao.p.p...@linux.intel.com> > > > Reviewed-by: Dario Faggioli <dario.faggi...@citrix.com> > > 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 = 255; > > static uint64_t rmid_mask; > > static DEFINE_PER_CPU(struct psr_assoc, psr_assoc); > > > > +static unsigned int get_socket_cpu(unsigned int socket) > > +{ > > + if ( socket < nr_sockets ) > > + return cpumask_any(socket_to_cpumask[socket]); > > + > ... What about > > if ( likely(socket < nr_sockets) )
Agreed, it can be an optimization chance. Let's see what others think. Thanks for review. Chao _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel