[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v4 02/12] x86: improve psr scheduling code
On 10/04/15 08:24, Chao Peng wrote: > On Thu, Apr 09, 2015 at 10:01:53PM +0100, Andrew Cooper wrote: >> On 09/04/2015 10:18, Chao Peng wrote: >>> +static inline void psr_assoc_init(unsigned int cpu) >>> +{ >>> + struct psr_assoc *psra = &per_cpu(psr_assoc, cpu); >>> + >>> + if ( psr_cmt_enabled() ) >>> + rdmsrl(MSR_IA32_PSR_ASSOC, psra->val); >>> +} >> On further consideration, this would probably be better as a void >> function which used this_cpu() rather than per_cpu(). >> >> Absolutely nothing good can come of calling it with cpu != >> smp_processor_id(), so we should avoid that situation arising in the >> first place. > Agreed. > >>> +static void psr_cpu_init(unsigned int cpu) >>> +{ >>> + psr_assoc_init(cpu); >>> +} >> This can also turn into a void helper. > This is, however, a little different. The next patch will add > cat_cpu_init() which will make use of this 'cpu' parameter. So do you > mean calling smp_processor_id() in cat_cpu_init() as well? Yes - that is probably best. While cat_cpu_init() doesn't actually interact with any MSRs, we still never want to be in a position to execute it against the "wrong" cpu. ~Andrew _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |