From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chao Peng Subject: Re: [PATCH 4/6] x86: add scheduling support for Intel CAT Date: Tue, 17 Mar 2015 17:33:41 +0800 Message-ID: <20150317093341.GF5371@pengc-linux.bj.intel.com> References: <1426241605-4114-1-git-send-email-chao.p.peng@linux.intel.com> <1426241605-4114-5-git-send-email-chao.p.peng@linux.intel.com> <5507FFBE020000780006A9A8@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: <5507FFBE020000780006A9A8@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 Tue, Mar 17, 2015 at 09:19:42AM +0000, Jan Beulich wrote: > > + psra->cos_mask = (~(~0ull << (get_count_order(info->cos_max) > > + + 32))) & (~0ull << 32); > > ((1ull << get_count_order()) - 1) << 32 > > seems better readable to me. Indeed :) > > > void psr_ctxt_switch_to(struct domain *d) > > { > > + uint64_t reg; > > + struct psr_assoc *psra = &this_cpu(psr_assoc); > > + > > + psr_assoc_reg_read(psra, ®); > > This ultimately leading to psr_assoc_init() makes it really undesirable > here imo: Initialization work shouldn't be done during a context > switch, even is this a one time thing on each CPU. This is what we did in CMT patch. But now I think psr_assoc_init() can be called from cat_cpu_init() other than here. Chao