From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chao Peng Subject: Re: [PATCH v2 4/7] x86: add support for COS/CBM manangement Date: Mon, 23 Mar 2015 16:47:45 +0800 Message-ID: <20150323084745.GK5371@pengc-linux.bj.intel.com> References: <1426761695-12545-1-git-send-email-chao.p.peng@linux.intel.com> <1426761695-12545-5-git-send-email-chao.p.peng@linux.intel.com> <550C6358020000780006C338@mail.emea.novell.com> Reply-To: Chao Peng Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <550C6358020000780006C338@mail.emea.novell.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: Jan Beulich Cc: wei.liu2@citrix.com, 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, keir@xen.org, dgdegra@tycho.nsa.gov List-Id: xen-devel@lists.xenproject.org On Fri, Mar 20, 2015 at 05:13:44PM +0000, Jan Beulich wrote: > >>> On 19.03.15 at 11:41, wrote: > > +static unsigned int get_socket_cpu(unsigned int socket) > > +{ > > + unsigned int cpu; > > + > > + for_each_online_cpu ( cpu ) > > + if ( cpu_to_socket(cpu) == socket ) > > + return cpu; > > + return nr_cpu_ids; > > +} > > This can be a rather long loop for a huge system. I think you need to > find some better solution for this. Maintain a socket_cpu_map for each socket? Sounds no existed way. > > +struct xen_domctl_psr_cat_op { > > +#define XEN_DOMCTL_PSR_CAT_OP_SET_L3_CBM 0 > > +#define XEN_DOMCTL_PSR_CAT_OP_GET_L3_CBM 1 > > + uint32_t cmd; /* IN: XEN_DOMCTL_PSR_CAT_OP_* */ > > + uint32_t target; /* IN: socket or cpu to be operated on */ > > How can this be socket _or_ CPU? This is for future feature like L2 cache which needs to specify cpu but not socket. Perhaps not mention here to avoid confusing. Chao