From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: Re: [PATCH 1/2] x86: during boot, anticipate identifying the boot cpu Date: Mon, 01 Sep 2014 16:24:30 +0100 Message-ID: <5404ABCE020000780002F895@mail.emea.novell.com> References: <20140822165628.32764.15082.stgit@Solace.lan> <20140822171534.32764.77550.stgit@Solace.lan> <53FB1246020000780002D125@mail.emea.novell.com> <54048CC6.2030006@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XOTT9-0001ag-Mt for xen-devel@lists.xenproject.org; Mon, 01 Sep 2014 15:24:36 +0000 In-Reply-To: <54048CC6.2030006@eu.citrix.com> Content-Disposition: inline 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 , George Dunlap Cc: Andrew Cooper , keir@xen.org, xen-devel List-Id: xen-devel@lists.xenproject.org >>> On 01.09.14 at 17:12, wrote: > On 08/25/2014 09:39 AM, Jan Beulich wrote: >>>>> On 22.08.14 at 19:15, wrote: >>> --- a/xen/arch/x86/setup.c >>> +++ b/xen/arch/x86/setup.c >>> @@ -1262,6 +1262,12 @@ void __init noreturn __start_xen(unsigned long mbi_p) >>> >>> timer_init(); >>> >>> + /* >>> + * Identify the boot CPU, in case the scheduler initialization >>> + * needs to know about it (e.g., topology, etc.) >>> + */ >>> + identify_cpu(&boot_cpu_data); >>> + >>> init_idle_domain(); >>> >>> trap_init(); >>> @@ -1272,8 +1278,6 @@ void __init noreturn __start_xen(unsigned long mbi_p) >>> >>> arch_init_memory(); >>> >>> - identify_cpu(&boot_cpu_data); >>> - >>> if ( cpu_has_fxsr ) >>> set_in_cr4(X86_CR4_OSFXSR); >>> if ( cpu_has_xmm ) >> I'm not sure about this part: It currently makes quite a bit of sense >> to have identify_cpu() immediately before explicit users of the >> gathered data (all code following up to the alternative_instructions() >> call). Perhaps if you move identify_cpu(), all the others should get >> moved too? > > Or possibly, move init_idle_domain() until after? I took a quick look > through the functions called between init_idle_domain() and > identify_cpu(), and didn't see any dependencies on the idle domain or > scheduling functions. It's quite possible I missed something though. If it wasn't scheduler_init() setting up the idle domain, moving it further down would have been an option; I'd rather not defer set_current() more than necessary, namely e.g. past rcu_init() (even if currently there may not be an actual dependency). Jan