Re: [Xen-devel] [PATCH v2] x86: correct socket_cpumask allocation

2015-07-09 Thread Chao Peng
On Thu, Jul 09, 2015 at 10:41:55AM +0100, Jan Beulich wrote: > >>> On 09.07.15 at 10:26, wrote: > > @@ -748,8 +758,9 @@ static int cpu_smpboot_alloc(unsigned int cpu) > > goto oom; > > per_cpu(stubs.addr, cpu) = stub_page + STUB_BUF_CPU_OFFS(cpu); > > > > -if ( !socket_cpumask[

Re: [Xen-devel] [PATCH v2] x86: correct socket_cpumask allocation

2015-07-09 Thread Jan Beulich
>>> On 09.07.15 at 10:26, wrote: > @@ -748,8 +758,9 @@ static int cpu_smpboot_alloc(unsigned int cpu) > goto oom; > per_cpu(stubs.addr, cpu) = stub_page + STUB_BUF_CPU_OFFS(cpu); > > -if ( !socket_cpumask[socket] && > - !zalloc_cpumask_var(socket_cpumask + socket) ) > +

Re: [Xen-devel] [PATCH v2] x86: correct socket_cpumask allocation

2015-07-09 Thread Andrew Cooper
On 09/07/15 09:26, Chao Peng wrote: > For booting cpu, the socket number is not needed to be 0 so > it needs to be computed by cpu number. > > For secondary cpu, phys_proc_id is not valid in CPU_PREPARE > notifier(cpu_smpboot_alloc), so cpu_to_socket(cpu) can't be used. > Instead, pre-allocate seco

Re: [Xen-devel] [PATCH v2] x86: correct socket_cpumask allocation

2015-07-09 Thread Dario Faggioli
On Thu, 2015-07-09 at 16:26 +0800, Chao Peng wrote: > For booting cpu, the socket number is not needed to be 0 so > it needs to be computed by cpu number. > > For secondary cpu, phys_proc_id is not valid in CPU_PREPARE > notifier(cpu_smpboot_alloc), so cpu_to_socket(cpu) can't be used. > Instead,

[Xen-devel] [PATCH v2] x86: correct socket_cpumask allocation

2015-07-09 Thread Chao Peng
For booting cpu, the socket number is not needed to be 0 so it needs to be computed by cpu number. For secondary cpu, phys_proc_id is not valid in CPU_PREPARE notifier(cpu_smpboot_alloc), so cpu_to_socket(cpu) can't be used. Instead, pre-allocate secondary_cpu_mask in cpu_smpboot_alloc() and later