From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chao Peng Subject: Re: [PATCH v5 12/13] tools: add tools support for Intel CAT Date: Wed, 22 Apr 2015 21:09:56 +0800 Message-ID: <20150422130956.GA6566@pengc-linux.bj.intel.com> References: <1429281230-4352-1-git-send-email-chao.p.peng@linux.intel.com> <1429281230-4352-13-git-send-email-chao.p.peng@linux.intel.com> <1429579477.18926.35.camel@citrix.com> <20150421094956.GD4453@pengc-linux.bj.intel.com> <1429624874.4743.101.camel@citrix.com> <1429627145.18926.107.camel@citrix.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: <1429627145.18926.107.camel@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: Dario Faggioli Cc: keir@xen.org, Ian Campbell , 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 On Tue, Apr 21, 2015 at 04:39:05PM +0200, Dario Faggioli wrote: > On Tue, 2015-04-21 at 15:01 +0100, Ian Campbell wrote: > > On Tue, 2015-04-21 at 17:49 +0800, Chao Peng wrote: > > > > I do like this suggestion and I have ever considered it actually. The > > > only thing prevents me is that we need an extra _get_socket_count in xl > > > for TARGET_ALL case. So libxl__count_physical_sockets is needed to be > > > public. If Ian/Wei have no concerns for this, then I'm glad to do this. > > > > I don't think you need libxl__count_physical_sockets for this, > > > I also don't think that is necessary. > > > the > > existing xl code for similar things just uses libxl_bitmap_set_any to > > handle the all case. > > > That or, if you want to do something similar to what we have in *libxl* > now you can look at the implementation of libxl_cpu_bitmap_alloc() (or > libxl_node_bitmap_alloc() ) and define yours > libxl_socket_bitmap_alloc(). > > In there, libxl_get_max_cpus() ( *_nodes()) is used, internally, to > determine the size of the bitmap, if the user did not provide it > explicitly. In your case, you can use libxl__count_physical_sockets() to > the same effect, without the need for it to be public. > > But then again, that is probably even not necessary. > I tend to add libxl_socket_bitmap_alloc(), otherwise a prediefined MAX_SOCKETS is needed. Chao