From: "Jan Beulich" Subject: Re: Assertion 'cpu < nr_cpu_ids' failed at .../src/new/xen-unstable/xen/include/xen/cpumask.h:97 Date: Mon, 23 Feb 2015 10:56:26 +0000 Message-ID: <54EB156A02000078000626B8@mail.emea.novell.com> References: <322729303.20150223102702@eikelenboom.it> <54EB09B1020000780006262F@mail.emea.novell.com> <54EB032C.5070608@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YPqgh-0002j1-ER for xen-devel@lists.xenproject.org; Mon, 23 Feb 2015 10:56:31 +0000 In-Reply-To: <54EB032C.5070608@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: Andrew Cooper , Sander Eikelenboom Cc: xen-devel List-Id: xen-devel@lists.xenproject.org >>> On 23.02.15 at 11:38, wrote: > On 23/02/15 10:06, Jan Beulich wrote: >>>>> On 23.02.15 at 10:27, wrote: >>> While shutting down all guests to go for a host reboot i encountered the >>> splat below. >>> This was running on Xen with: >>> xen_changeset: Fri Feb 20 16:21:10 2015 +0100 git:24b2b8d-dirty >> "-dirty" meaning what? >> >>> (XEN) [2015-02-23 09:16:26.292] Assertion 'cpu < nr_cpu_ids' failed at > .../src/new/xen-unstable/xen/include/xen/cpumask.h:97 >> Since with debug=y the callstack entries should be reliable, I can't >> see how this matches up with ... >> >>> (XEN) [2015-02-23 09:16:26.292] Xen call trace: >>> (XEN) [2015-02-23 09:16:26.292] [] > cpu_raise_softirq+0xd7/0xeb >> ... this, since >> >> void cpu_raise_softirq(unsigned int cpu, unsigned int nr) >> { >> unsigned int this_cpu = smp_processor_id(); >> >> if ( test_and_set_bit(nr, &softirq_pending(cpu)) >> || (cpu == this_cpu) >> || arch_skip_send_event_check(cpu) ) >> return; >> >> if ( !per_cpu(batching, this_cpu) || in_irq() ) >> smp_send_event_check_cpu(cpu); >> else >> set_bit(nr, &per_cpu(batch_mask, this_cpu)); >> } >> >> doesn't indicate any use of cpumask functions. If, however, >> arch_skip_send_event_check()'s call to cpumask_test_cpu() >> didn't get inlined, that might be the cause. Albeit that would mean >> smp_processor_id() returned an out-of-range value... In any >> event we'll need to know what exactly above code location refers >> to inside the entire function. > > Are you sure your code is up to date? > > Current staging has Ah, I looked at master, not staging. > void cpu_raise_softirq(unsigned int cpu, unsigned int nr) > { > unsigned int this_cpu = smp_processor_id(); > > if ( test_and_set_bit(nr, &softirq_pending(cpu)) > || (cpu == this_cpu) > || arch_skip_send_event_check(cpu) ) > return; > > if ( !per_cpu(batching, this_cpu) || in_irq() ) > smp_send_event_check_cpu(cpu); > else > __cpumask_set_cpu(nr, &per_cpu(batch_mask, this_cpu)); > } > > > And furthermore, I think the final __cpumask_set_cpu(...) appears > wrong. The first parameter should be 'cpu' rather than 'nr'. I am not > surprised that the ASSERT() is firing. No, the conversion to __cpumask_set_cpu() was wrong here in the first place - this ought to be __set_bit(). Will submit a fix in a minute. Jan