From: "Jan Beulich" Subject: Re: [PATCH v3] x86: correct socket_cpumask allocation Date: Fri, 10 Jul 2015 16:13:35 +0100 Message-ID: <559FFD3F020000780008F9D5@mail.emea.novell.com> References: <1436451837-26171-1-git-send-email-chao.p.peng@linux.intel.com> <1436538580.22672.420.camel@citrix.com> <559FDB1A.8030402@citrix.com> <1436540235.22672.425.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1436540235.22672.425.camel@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 , Chao Peng Cc: Andrew Cooper , boris.ostrovsky@oracle.com, keir@xen.org, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org >>> On 10.07.15 at 16:57, wrote: > I added this printk: > > printk(" cpu=%u cpu_to_socket=%u\n", cpu, socket); > > Right before this chunk of code, in cpu_smpboot_free(): > > if ( cpumask_empty(socket_cpumask[socket]) ) > { > xfree(socket_cpumask[socket]); > socket_cpumask[socket] = NULL; > } > > And it says this: > > ... > (XEN) Preparing system for ACPI S5 state. > (XEN) Disabling non-boot CPUs ... > (XEN) Broke affinity for irq 9 > (XEN) cpu=1 cpu_to_socket=4294967295 > (XEN) ----[ Xen-4.6-unstable x86_64 debug=y Tainted: C ]---- > (XEN) CPU: 0 > (XEN) RIP: e008:[] cpu_smpboot_free+0x43/0x28b > ... > > I.e., it looks like phys_proc_id has already been reset to > XEN_INVALID_SOCKET_ID, as we're kind-of racing with > remove_siblinginfo(). Right. We have cpu_down() stop_machine_run(take_cpu_down, ...) notifier_call_chain(&cpu_chain, CPU_DYING, ...) __cpu_disable() remove_siblinginfo() __cpu_die() notifier_call_chain(&cpu_chain, CPU_DEAD, ...) cpu_smpboot_free() I.e. a clear use-after-invalidate. Jan