From: "andrzej zaborowski" <balrogg@gmail.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] qemu vl.c
Date: Tue, 18 Dec 2007 01:40:17 +0100 [thread overview]
Message-ID: <fb249edb0712171640x4d7c4b4ajc7fcad7225dce1b8@mail.gmail.com> (raw)
In-Reply-To: <3924.N1pNGSpdEBQ=.1197935190.squirrel@webmail.hotelhot.dk>
[-- Attachment #1: Type: text/plain, Size: 1805 bytes --]
On 18/12/2007, Anders <mail@flac.kalibalik.dk> wrote:
>
> >>>>> Redundant timer rearm optimisation by Anders Melchiorsen.
>
> > I'm merging qemu-cvs into the kvm repository now, and with this commit
> > in, kvm will hang after about a minute. Attaching to it with gdb or
> > strace will cause it to resume, so this is very likely a missing signal
> > problem.
>
> That is clearly not good.
>
> I still cannot see anything wrong with my patch. As fewer signals are
> delivered now, it is possible that this change highlights some old race.
Yes, I don't see anything wrong in this change either but I see how
the scenario given by Paul was already buggy before. Paul confirmed on
IRC that this is also what he meant.
I suspect it was buggy since "unix" and "rtc" stopped being the only
available clock sources.
> It is certainly also possible that my patch is all wrong, even if I am not
> able to see it.
>
>
> The next few days I will be travelling, but when I get back, I was
> planning to address Pauls concern by adding
>
> qemu_rearm_alarm_timer(alarm_timer);
That would be also my first guess at fixing this, but I have no good
test-case (obviously I wouldn't have committed the change if I had
such a test-case).
>
> to the bottom of qemu_mod_timer().
>
> If you feel like it, you can try that out. I am predicting that I will
> have a hard time reproducing your hang, as I have only been testing with
> kvm, and obviously not seen this problem yet.
>
> (What I really plan to add is a rearm only if the new timer is added at
> the head of the list, but the above should do for a test)
Attached is a small patch to do exactly this. The rearming in
main_loop_wait() can also be made conditional but I don't think there
would be a real gain.
Testing with KVM will be appreciated.
Regards
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: qemu-timers.patch --]
[-- Type: text/x-patch; name=qemu-timers.patch, Size: 402 bytes --]
diff --git a/vl.c b/vl.c
index 70950f8..7552fde 100644
--- a/vl.c
+++ b/vl.c
@@ -1041,6 +1041,10 @@ void qemu_mod_timer(QEMUTimer *ts, int64_t expire_time)
ts->expire_time = expire_time;
ts->next = *pt;
*pt = ts;
+
+ /* rearm if the necessary */
+ if (pt == &active_timers[ts->clock->type])
+ qemu_rearm_alarm_timer(alarm_timer);
}
int qemu_timer_pending(QEMUTimer *ts)
next prev parent reply other threads:[~2007-12-18 0:40 UTC|newest]
Thread overview: 146+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-16 13:17 [Qemu-devel] qemu vl.c Andrzej Zaborowski
2007-12-16 14:30 ` Paul Brook
2007-12-16 15:26 ` Anders
2007-12-17 0:58 ` Paul Brook
2007-12-17 21:36 ` Avi Kivity
2007-12-17 23:46 ` Anders
2007-12-18 0:40 ` andrzej zaborowski [this message]
2007-12-18 16:48 ` Avi Kivity
2007-12-18 23:57 ` Anders
-- strict thread matches above, loose matches on Subject: below --
2008-03-24 2:31 Paul Brook
2008-03-09 23:43 Aurelien Jarno
2008-02-03 3:45 Andrzej Zaborowski
2008-01-14 3:11 Andrzej Zaborowski
2008-01-08 19:32 Thiemo Seufer
2008-01-05 19:41 Andrzej Zaborowski
2007-12-24 13:58 Andrzej Zaborowski
2007-12-16 11:48 Andrzej Zaborowski
2007-12-06 22:11 Andrzej Zaborowski
2007-12-03 3:01 Andrzej Zaborowski
2007-11-24 23:27 Andrzej Zaborowski
2007-11-19 1:05 Jocelyn Mayer
2007-11-15 19:04 Paul Brook
2007-10-26 17:21 Thiemo Seufer
2007-10-21 23:20 Thiemo Seufer
2007-10-26 15:49 ` Stefan Weil
2007-10-26 16:48 ` Johannes Schindelin
2007-10-26 17:24 ` Thiemo Seufer
2007-10-04 19:59 Andrzej Zaborowski
2007-10-04 19:47 Andrzej Zaborowski
2007-09-17 21:25 Andrzej Zaborowski
2007-09-16 19:53 Thiemo Seufer
2007-08-28 22:21 Thiemo Seufer
2007-08-26 17:31 Thiemo Seufer
2007-08-26 17:29 Thiemo Seufer
2007-08-25 1:34 Thiemo Seufer
2007-08-24 1:46 Thiemo Seufer
2007-08-24 1:36 Thiemo Seufer
2007-08-24 1:26 Thiemo Seufer
2007-08-23 20:22 Paul Brook
2007-08-20 15:42 Thiemo Seufer
2007-08-19 22:09 Thiemo Seufer
2007-07-02 15:03 Andrzej Zaborowski
2007-07-02 13:31 Andrzej Zaborowski
2007-07-02 13:20 Andrzej Zaborowski
2007-06-29 23:26 Thiemo Seufer
2007-06-28 15:14 Thiemo Seufer
2007-06-28 14:05 Thiemo Seufer
2007-06-25 11:48 Thiemo Seufer
2007-06-28 8:24 ` Andreas Färber
2007-06-28 8:32 ` Andreas Färber
2007-06-23 16:01 Thiemo Seufer
2007-06-22 8:23 Andrzej Zaborowski
2007-06-21 23:34 Thiemo Seufer
2007-05-28 2:29 Paul Brook
2007-05-18 17:46 Andrzej Zaborowski
2007-05-13 14:54 Thiemo Seufer
2007-05-03 10:13 Andrzej Zaborowski
2007-04-28 20:49 Thiemo Seufer
2007-04-18 18:11 Thiemo Seufer
2007-04-18 17:56 Thiemo Seufer
2007-03-25 20:27 Thiemo Seufer
2007-03-25 15:58 Thiemo Seufer
2007-03-22 12:36 Thiemo Seufer
2007-03-19 16:36 Thiemo Seufer
2007-03-19 15:58 Thiemo Seufer
2007-03-11 18:54 Paul Brook
2007-02-28 21:59 Thiemo Seufer
2007-02-21 17:25 Thiemo Seufer
2007-02-19 1:10 Thiemo Seufer
2007-02-17 22:54 Thiemo Seufer
2007-02-10 21:50 Thiemo Seufer
2007-02-02 3:30 Thiemo Seufer
2007-02-03 4:20 ` Kazu
2007-02-05 11:52 ` Johannes Schindelin
2007-01-27 17:19 Paul Brook
2007-01-27 18:22 ` Stefan Weil
2007-01-27 18:38 ` Paul Brook
2007-01-27 17:11 Paul Brook
2007-01-09 19:44 Fabrice Bellard
2006-12-23 22:51 Thiemo Seufer
2006-12-23 15:37 Paul Brook
2006-12-22 21:20 Thiemo Seufer
2006-12-22 19:25 Thiemo Seufer
2006-12-22 17:29 Thiemo Seufer
2006-11-01 1:44 Paul Brook
2006-09-10 14:39 Paul Brook
2006-09-09 11:10 Fabrice Bellard
2006-08-17 9:43 Fabrice Bellard
2006-08-07 21:34 Fabrice Bellard
2006-08-06 13:36 Fabrice Bellard
2006-07-15 17:40 Paul Brook
2006-07-14 9:36 Fabrice Bellard
2006-06-26 20:03 Fabrice Bellard
2006-06-25 16:25 Fabrice Bellard
2006-05-01 13:33 Fabrice Bellard
2006-05-01 13:28 Fabrice Bellard
2006-05-01 13:23 Fabrice Bellard
2006-05-01 12:43 Fabrice Bellard
2006-04-30 22:20 Fabrice Bellard
2006-03-28 20:20 Paul Brook
2006-02-10 17:34 Paul Brook
2006-02-08 22:46 Fabrice Bellard
2006-02-01 21:29 Fabrice Bellard
2006-01-08 10:53 Fabrice Bellard
2005-12-18 19:09 Fabrice Bellard
2005-12-18 18:02 Fabrice Bellard
2005-11-27 19:10 Fabrice Bellard
2005-11-26 20:10 Fabrice Bellard
2005-11-23 21:01 Fabrice Bellard
2005-11-11 0:00 Fabrice Bellard
2005-09-03 21:33 Fabrice Bellard
2005-09-03 15:28 Fabrice Bellard
2005-06-05 14:49 Fabrice Bellard
2005-04-06 20:32 Fabrice Bellard
2005-03-01 21:28 Fabrice Bellard
2005-01-30 22:57 Fabrice Bellard
2005-01-26 21:56 Fabrice Bellard
2005-01-15 21:50 Fabrice Bellard
2005-01-09 0:22 Fabrice Bellard
2005-01-09 0:58 ` Phil Krylov
2005-01-09 10:48 ` Daniel Egger
2005-01-06 21:06 Fabrice Bellard
2005-01-03 23:48 Fabrice Bellard
2004-12-12 22:43 Fabrice Bellard
2004-11-14 15:48 Fabrice Bellard
2003-12-02 22:18 Fabrice Bellard
2003-11-16 19:46 Fabrice Bellard
2003-11-16 15:59 Fabrice Bellard
2003-11-11 13:36 Fabrice Bellard
2003-11-04 23:35 Fabrice Bellard
2003-10-30 1:11 Fabrice Bellard
2003-10-27 23:37 Fabrice Bellard
2003-10-27 21:18 Fabrice Bellard
2003-09-30 22:11 Fabrice Bellard
2003-09-30 21:40 Fabrice Bellard
2003-09-30 21:07 Fabrice Bellard
2003-09-16 21:46 Fabrice Bellard
2003-07-27 22:19 Fabrice Bellard
2003-07-26 18:11 Fabrice Bellard
2003-07-04 14:38 Fabrice Bellard
2003-07-01 15:07 Fabrice Bellard
2003-06-30 23:36 Fabrice Bellard
2003-06-30 13:06 Fabrice Bellard
2003-06-27 12:01 Fabrice Bellard
2003-06-25 16:20 Fabrice Bellard
2003-06-25 0:07 Fabrice Bellard
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=fb249edb0712171640x4d7c4b4ajc7fcad7225dce1b8@mail.gmail.com \
--to=balrogg@gmail.com \
--cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).