From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chao Peng Subject: Re: [PATCH v8 03/13] x86: maintain COS to CBM mapping for each socket Date: Fri, 29 May 2015 16:38:31 +0800 Message-ID: <20150529083831.GF18422@pengc-linux.bj.intel.com> References: <1432197704-20816-1-git-send-email-chao.p.peng@linux.intel.com> <1432197704-20816-4-git-send-email-chao.p.peng@linux.intel.com> <556731A2020000780007E99B@mail.emea.novell.com> <20150529024259.GC18422@pengc-linux.bj.intel.com> <55683A36020000780007ED4D@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: <55683A36020000780007ED4D@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, dario.faggioli@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, May 29, 2015 at 09:06:46AM +0100, Jan Beulich wrote: > >>> On 29.05.15 at 04:43, wrote: > > On Thu, May 28, 2015 at 02:17:54PM +0100, Jan Beulich wrote: > >> >>> On 21.05.15 at 10:41, wrote: > >> > +static int cat_cpu_init(unsigned int cpu) > >> > +{ > >> > + int rc; > >> > + const struct cpuinfo_x86 *c = cpu_data + cpu; > >> > + > >> > + if ( !cpu_has(c, X86_FEATURE_CAT) ) > >> > + return 0; > >> > + > >> > + if ( test_bit(cpu_to_socket(cpu), cat_socket_enable) ) > >> > + return 0; > >> > + > >> > + if ( cpu == smp_processor_id() ) > >> > + do_cat_cpu_init(&rc); > >> > + else > >> > + on_selected_cpus(cpumask_of(cpu), do_cat_cpu_init, &rc, 1); > >> > >> This now being called in the context of CPU_UP_PREPARE, I can't see > >> how this works at all: Neither would the CPU's cpu_data[] instance be > >> initialized by that time, nor would you be able to IPI that CPU, nor can I > >> see how the if() branch could ever get entered. Was this tested at all? > > > > Ah, yes! So it sounds really a little difficult to move the memory > > allocation from CPU_STARTING to CPU_PREPARA for this case. > > Not sure why you talk about memory allocation again. That should > be done in CPU_UP_PREPARE. But stuff that needs to happen on > the CPU should happen in CPU_STARTING. The memory allocation's > size depending on a CPU characteristic of course makes this a little > problematic, but (I think I said so before) since we're assuming > symmetry in many other places, I don't see anything wrong with > you assuming symmetry here too, and hence use e.g. the boot CPU's > value to determine the allocation size. No problem, then I can just forget the support for asymmetry in XEN. Chao