From: "Pavel Dovgalyuk" <dovgaluk@ispras.ru>
To: "'Paolo Bonzini'" <pbonzini@redhat.com>,
"'Pavel Dovgalyuk'" <pavel.dovgaluk@gmail.com>,
<qemu-devel@nongnu.org>
Cc: kwolf@redhat.com, peter.maydell@linaro.org,
pavel.dovgaluk@ispras.ru, quintela@redhat.com,
ciro.santilli@gmail.com, jasowang@redhat.com,
crosthwaite.peter@gmail.com, armbru@redhat.com,
mreitz@redhat.com, alex.bennee@linaro.org,
maria.klimushenkova@ispras.ru, mst@redhat.com, kraxel@redhat.com,
boost.lists@gmail.com, thomas.dullien@googlemail.com,
artem.k.pisarenko@gmail.com, dgilbert@redhat.com,
rth@twiddle.net
Subject: Re: [Qemu-devel] [PATCH for-4.2 10/14] util/qemu-timer: refactor deadline calculation for external timers
Date: Thu, 25 Jul 2019 09:00:18 +0300 [thread overview]
Message-ID: <000701d542ae$3cbfc080$b63f4180$@ru> (raw)
In-Reply-To: <55b86868-36a1-def1-8ef0-ca00ab273645@redhat.com>
> From: Paolo Bonzini [mailto:pbonzini@redhat.com]
> On 24/07/19 10:44, Pavel Dovgalyuk wrote:
> > -int64_t qemu_clock_deadline_ns_all(QEMUClockType type)
> > +int64_t virtual_clock_deadline_ns(void)
> > {
> > int64_t deadline = -1;
> > + int64_t delta;
> > + int64_t expire_time;
> > + QEMUTimer *ts;
> > QEMUTimerList *timer_list;
> > - QEMUClock *clock = qemu_clock_ptr(type);
> > + QEMUClock *clock = qemu_clock_ptr(QEMU_CLOCK_VIRTUAL);
> > +
> > + if (!clock->enabled) {
> > + return -1;
> > + }
> > +
> > QLIST_FOREACH(timer_list, &clock->timerlists, list) {
> > - deadline = qemu_soonest_timeout(deadline,
> > - timerlist_deadline_ns(timer_list));
> > + qemu_mutex_lock(&timer_list->active_timers_lock);
> > + ts = timer_list->active_timers;
> > + /* Skip all external timers */
> > + while (ts && (ts->attributes & QEMU_TIMER_ATTR_EXTERNAL)) {
> > + ts = ts->next;
> > + }
> > + if (!ts) {
> > + qemu_mutex_unlock(&timer_list->active_timers_lock);
> > + continue;
> > + }
> > + expire_time = ts->expire_time;
> > + qemu_mutex_unlock(&timer_list->active_timers_lock);
> > +
> > + delta = expire_time - qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
> > + if (delta <= 0) {
> > + delta = 0;
> > + }
> > + deadline = qemu_soonest_timeout(deadline, delta);
> > }
> > return deadline;
> > }
> >
>
> Why would this change be exclusive to QEMU_CLOCK_VIRTUAL? I don't think
> it's useful to remove the argument. Otherwise, the patch makes sense.
Ok, I'll rewrite this one and keep the argument.
Pavel Dovgalyuk
next prev parent reply other threads:[~2019-07-25 6:00 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-24 8:43 [Qemu-devel] [PATCH for-4.2 00/14] Some record/replay fixes Pavel Dovgalyuk
2019-07-24 8:43 ` [Qemu-devel] [PATCH for-4.2 01/14] replay: add missing fix for internal function Pavel Dovgalyuk
2019-07-24 8:43 ` [Qemu-devel] [PATCH for-4.2 02/14] block: implement bdrv_snapshot_goto for blkreplay Pavel Dovgalyuk
2019-07-24 8:43 ` [Qemu-devel] [PATCH for-4.2 03/14] replay: disable default snapshot for record/replay Pavel Dovgalyuk
2019-07-24 8:43 ` [Qemu-devel] [PATCH for-4.2 04/14] replay: update docs for record/replay with block devices Pavel Dovgalyuk
2019-07-24 8:43 ` [Qemu-devel] [PATCH for-4.2 05/14] replay: don't drain/flush bdrv queue while RR is working Pavel Dovgalyuk
2019-07-24 8:43 ` [Qemu-devel] [PATCH for-4.2 06/14] replay: finish record/replay before closing the disks Pavel Dovgalyuk
2019-07-24 8:43 ` [Qemu-devel] [PATCH for-4.2 07/14] replay: provide an accessor for rr filename Pavel Dovgalyuk
2019-07-24 8:43 ` [Qemu-devel] [PATCH for-4.2 08/14] replay: add BH oneshot event for block layer Pavel Dovgalyuk
2019-07-24 8:44 ` [Qemu-devel] [PATCH for-4.2 09/14] replay: document development rules Pavel Dovgalyuk
2019-07-24 8:44 ` [Qemu-devel] [PATCH for-4.2 10/14] util/qemu-timer: refactor deadline calculation for external timers Pavel Dovgalyuk
2019-07-24 14:28 ` Paolo Bonzini
2019-07-25 6:00 ` Pavel Dovgalyuk [this message]
2019-07-24 8:44 ` [Qemu-devel] [PATCH for-4.2 11/14] replay: fix replay shutdown Pavel Dovgalyuk
2019-07-24 8:44 ` [Qemu-devel] [PATCH for-4.2 12/14] replay: refine replay-time module Pavel Dovgalyuk
2019-07-24 8:44 ` [Qemu-devel] [PATCH for-4.2 13/14] replay: rename step-related variables and functions Pavel Dovgalyuk
2019-07-24 8:44 ` [Qemu-devel] [PATCH for-4.2 14/14] icount: clean up cpu_can_io before jumping to the next block Pavel Dovgalyuk
2019-07-24 14:35 ` Paolo Bonzini
2019-07-25 5:55 ` Pavel Dovgalyuk
2019-07-25 6:27 ` Paolo Bonzini
2019-07-24 14:35 ` [Qemu-devel] [PATCH for-4.2 00/14] Some record/replay fixes Paolo Bonzini
2019-07-25 8:44 ` Kevin Wolf
2019-07-25 8:46 ` Pavel Dovgalyuk
2019-07-31 5:41 ` Pavel Dovgalyuk
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='000701d542ae$3cbfc080$b63f4180$@ru' \
--to=dovgaluk@ispras.ru \
--cc=alex.bennee@linaro.org \
--cc=armbru@redhat.com \
--cc=artem.k.pisarenko@gmail.com \
--cc=boost.lists@gmail.com \
--cc=ciro.santilli@gmail.com \
--cc=crosthwaite.peter@gmail.com \
--cc=dgilbert@redhat.com \
--cc=jasowang@redhat.com \
--cc=kraxel@redhat.com \
--cc=kwolf@redhat.com \
--cc=maria.klimushenkova@ispras.ru \
--cc=mreitz@redhat.com \
--cc=mst@redhat.com \
--cc=pavel.dovgaluk@gmail.com \
--cc=pavel.dovgaluk@ispras.ru \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=rth@twiddle.net \
--cc=thomas.dullien@googlemail.com \
/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).