From: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
To: david ahern <daahern-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: soft lockup in kvm_flush_remote_tlbs
Date: Thu, 25 Oct 2007 15:46:11 +0200 [thread overview]
Message-ID: <47209E23.8080808@qumranet.com> (raw)
In-Reply-To: <47209A77.3090503-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
david ahern wrote:
> As a quick test I added a printk to the loop, right after the while():
>
> while (atomic_read(&completed) != needed) {
> printk("kvm_flush_remote_tlbs: completed = %d, needed = %d\n", atomic_read(&completed), needed);
> cpu_relax();
> barrier();
> }
>
>
> This is the output right before a lockup:
>
> Oct 24 16:03:47 bldr-ccm20 kernel: kvm_flush_remote_tlbs: completed = 2, needed = 2
> Oct 24 16:03:47 bldr-ccm20 kernel: kvm_flush_remote_tlbs: completed = 2, needed = 2
> Oct 24 16:03:47 bldr-ccm20 kernel: kvm_flush_remote_tlbs: completed = 1, needed = 2
> Oct 24 16:03:57 bldr-ccm20 last message repeated 105738 times
> Oct 24 16:03:57 bldr-ccm20 kernel: BUG: soft lockup detected on CPU#0!
> Oct 24 16:03:57 bldr-ccm20 kernel: [<c044a0b7>] softlockup_tick+0x98/0xa6
> Oct 24 16:03:57 bldr-ccm20 kernel: [<c042cc98>] update_process_times+0x39/0x5c
> Oct 24 16:03:57 bldr-ccm20 kernel: [<c04176ec>] smp_apic_timer_interrupt+0x5c/0x64
> Oct 24 16:03:57 bldr-ccm20 kernel: [<c04049bf>] apic_timer_interrupt+0x1f/0x24
> Oct 24 16:03:57 bldr-ccm20 kernel: [<c0424130>] vprintk+0x288/0x2bc
> Oct 24 16:03:57 bldr-ccm20 kernel: [<c0459db7>] follow_page+0x168/0x1b6
> Oct 24 16:03:57 bldr-ccm20 kernel: [<c04d8067>] cfq_slice_async_store+0x5/0x38
> Oct 24 16:03:57 bldr-ccm20 kernel: [<c0459db7>] follow_page+0x168/0x1b6
> Oct 24 16:03:57 bldr-ccm20 kernel: [<c0406406>] do_IRQ+0xa5/0xae
> Oct 24 16:03:57 bldr-ccm20 kernel: [<c040492e>] common_interrupt+0x1a/0x20
> Oct 24 16:03:57 bldr-ccm20 kernel: [<c042417c>] printk+0x18/0x8e
> Oct 24 16:03:57 bldr-ccm20 kernel: [<f89a9812>] kvm_flush_remote_tlbs+0xe0/0xf2 [kvm]
> ...
>
>
> I'd like to get a solution for RHEL5, so I am attempting to backport smp_call_function_mask(). I'm open to other suggestions if you think it is corruption or the problem is somewhere else.
>
No, it looks like the problem is indeed in kvm_flush_remote_tlbs(), and
not a corruption elsewhere.
Things to check:
- whether cpus_weight(mask) == needed
- whether wrapping the whole thing in preempt_disable()/preempt_enable()
helps
hey! I see a bug!
> continue;
> cpu = vcpu->cpu;
> if (cpu != -1 && cpu != raw_smp_processor_id())
> if (!cpu_isset(cpu, cpus)) {
> cpu_set(cpu, cpus);
> ++needed;
> }
> }
>
vcpu->cpu can change during execution if this snippet due to a vcpu
being migrated concurrently with this being executed. Since the
compiler is free to reload 'cpu' from 'vcpu->cpu', the code can operate
on corrupted data.
A 'barrier();' after 'cpu = vcpu->cpu;' should fix it, if this is indeed
the bug.
--
error compiling committee.c: too many arguments to function
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
next prev parent reply other threads:[~2007-10-25 13:46 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-24 23:00 soft lockup in kvm_flush_remote_tlbs david ahern
[not found] ` <471FCEA6.6000903-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2007-10-24 23:15 ` Laurent Vivier
[not found] ` <471FD204.6040400-6ktuUTfB/bM@public.gmane.org>
2007-10-25 4:26 ` david ahern
2007-10-25 6:47 ` Avi Kivity
[not found] ` <47203BEB.9070509-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-10-25 13:30 ` david ahern
[not found] ` <47209A77.3090503-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2007-10-25 13:46 ` Avi Kivity [this message]
[not found] ` <47209E23.8080808-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-10-25 14:07 ` david ahern
2007-10-25 18:34 ` david ahern
[not found] ` <4720E19B.20802-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2007-10-25 18:35 ` Avi Kivity
[not found] ` <4720E1EB.6020700-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-10-25 23:05 ` david ahern
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=47209E23.8080808@qumranet.com \
--to=avi-atkuwr5tajbwk0htik3j/w@public.gmane.org \
--cc=daahern-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org \
--cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox