From: Laine Stump <laine@redhat.com>
To: Gerhard Wiesinger <lists@wiesinger.com>,
Paolo Bonzini <pbonzini@redhat.com>,
qemu-devel@nongnu.org, Cole Robinson <crobinso@redhat.com>,
virt@lists.fedoraproject.org
Subject: Re: [Qemu-devel] Fedora FC21 - Bug: 100% CPU and hangs in gettimeofday(&tp, NULL); forever
Date: Tue, 13 Jan 2015 19:59:11 -0500 [thread overview]
Message-ID: <54B5BF5F.9000805@redhat.com> (raw)
In-Reply-To: <54B595C7.3080101@wiesinger.com>
On 01/13/2015 05:01 PM, Gerhard Wiesinger wrote:
> On 13.01.2015 22:16, Paolo Bonzini wrote:
>>
>> On 13/01/2015 22:14, Gerhard Wiesinger wrote:
>>> I also had a look at the kernel code again:
>>> http://lxr.free-electrons.com/source/kernel/time/timekeeping.c?v=3.17#L493
>>>
>>> 499 do {
>>> 500 seq = read_seqcount_begin(&tk_core.seq);
>>> 501
>>> 502 ts->tv_sec = tk->xtime_sec;
>>> 503 nsecs = timekeeping_get_ns(&tk->tkr);
>>> 504
>>> 505 } while (read_seqcount_retry(&tk_core.seq, seq));
>>>
>>> So it looks like that the seqcount always changes and therefore loops
>>> forever here (as far as I digged it down this is the only loop here).
>>>
>>> Might be something wrong with the memory barriers in recent qemu-kvm
>>> releases?
>> No, that's not possible. Unless you pause/resume or migrate the VM, all
>> of the handling of kvmclock is entirely in the kernel.
>
> Any other possible explaination of the problem?
>
> Had a look at the diff (I guess the right file at least in qemu tree):
> # no critical changes IHMO here
> git diff -u v1.6.2..v2.1.2 ./hw/i386/kvm/clock.c
>
> Trying to reproduce with a loop:
> #include <sys/time.h>
> #include <stdio.h>
>
> int main(int argc, char* argv[])
> {
> struct timeval tv;
> int i = 0;
> for (;;)
> {
> gettimeofday(&tv, 0);
> ++i;
> if (i >= 10000000)
> {
> i = 0;
> printf("%i\n", (int)tv.tv_sec);
> }
> }
> return 0;
> }
>
> As I wrote this: "First tests seem to run well, so no quick win ....",
> I could reproduce it with a stall in 318s :-)
> (gdb) bt
> #0 0x00007fff6d9fefff in gettimeofday ()
> #1 0x00000000004005ad in main (argc=1, argv=0x7fff6d9b28b8) at
> gettimeofdayloop.c:10
>
> So we have at least a testcase which is quickly to reproduce.
>
> So we are digging down my second findings about a major bug in
> qemu-kvm :-)
>
> Can someone try, too?
>
> Ciao,
> Gerhard
>
>
Take a look at the following kernel bug. It specifically deals with a
hang in gettimeofday() in a KVM guest:
https://bugzilla.redhat.com/show_bug.cgi?id=1178975
There is a link to a patched kernel you can try; it fixed my problems (I
was repeatedly getting hangs in python-urlgrabber during yum updates on
F21).
next prev parent reply other threads:[~2015-01-14 0:59 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-08 13:36 [Qemu-devel] Fedora FC21 - Bug: 100% CPU and hangs in gettimeofday(&tp, NULL); forever Gerhard Wiesinger
2015-01-08 17:24 ` Paolo Bonzini
2015-01-08 18:12 ` Gerhard Wiesinger
2015-01-08 18:22 ` Paolo Bonzini
2015-01-08 22:28 ` Gerhard Wiesinger
2015-01-08 22:42 ` Paolo Bonzini
2015-01-12 11:41 ` Gerhard Wiesinger
2015-01-12 11:46 ` Paolo Bonzini
2015-01-12 11:53 ` Gerhard Wiesinger
2015-01-12 11:54 ` Paolo Bonzini
2015-01-13 20:13 ` Gerhard Wiesinger
2015-01-13 20:48 ` Paolo Bonzini
2015-01-13 21:08 ` Cole Robinson
2015-01-13 21:14 ` Gerhard Wiesinger
2015-01-13 21:16 ` Paolo Bonzini
2015-01-13 22:01 ` Gerhard Wiesinger
2015-01-14 0:59 ` Laine Stump [this message]
2015-01-14 9:15 ` Gerhard Wiesinger
2015-02-15 8:18 ` Gerhard Wiesinger
2015-02-16 14:18 ` Paolo Bonzini
2015-02-16 15:09 ` Gerhard Wiesinger
2015-02-16 15:29 ` Paolo Bonzini
2015-03-01 10:36 ` Gerhard Wiesinger
2015-03-02 9:26 ` Paolo Bonzini
2015-03-02 15:52 ` Gerhard Wiesinger
2015-03-02 17:15 ` Gerhard Wiesinger
2015-03-03 9:12 ` Gerhard Wiesinger
2015-03-03 10:12 ` Paolo Bonzini
2015-03-03 11:51 ` Gonglei
2015-03-03 12:28 ` Gerhard Wiesinger
2015-03-03 13:18 ` Gerhard Wiesinger
2015-03-03 20:50 ` Gerhard Wiesinger
2015-01-14 17:47 ` Juan Quintela
2015-01-14 17:52 ` Juan Quintela
2015-01-14 22:19 ` Gerhard Wiesinger
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=54B5BF5F.9000805@redhat.com \
--to=laine@redhat.com \
--cc=crobinso@redhat.com \
--cc=lists@wiesinger.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=virt@lists.fedoraproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.