From: Dave Winchell <dwinchell@virtualiron.com>
To: "dan.magenheimer@oracle.com" <dan.magenheimer@oracle.com>,
Keir Fraser <Keir.Fraser@cl.cam.ac.uk>
Cc: Dave Winchell <dwinchell@virtualiron.com>,
"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [PATCH] Add a timer mode that disables pending missed ticks
Date: Fri, 04 Jan 2008 18:24:02 -0500 [thread overview]
Message-ID: <477EC012.6040206@virtualiron.com> (raw)
In-Reply-To: <20080103155752531.00000000500@djm-pc>
[-- Attachment #1: Type: text/plain, Size: 9851 bytes --]
Hi Dan and Keir,
Attached is a patch that fixes some issues with the SYNC policy
(no_missed_ticks_pending).
I have not tried to make the change the minimal one, but, rather, just
ported into
the new code what I know to work well. The error for
no_missed_ticks_pending goes from
over 3% to .03% with this change according to my testing.
Regards,
Dave
Dan Magenheimer wrote:
>Hi Dave --
>
>Did you get your correction ported? If so, it would be nice to see this get into 3.1.3.
>
>Note that I just did some very limited testing with timer_mode=2(=SYNC=no missed ticks pending)
>on tip of xen-3.1-testing (64-bit Linux hv guest) and the worst error I've seen so far
>is 0.012%. But I haven't tried any exotic loads, just LTP.
>
>Thanks,
>Dan
>
>
>
>>-----Original Message-----
>>From: Dave Winchell [mailto:dwinchell@virtualiron.com]
>>Sent: Wednesday, December 19, 2007 12:33 PM
>>To: dan.magenheimer@oracle.com
>>Cc: Keir Fraser; Shan, Haitao; xen-devel@lists.xensource.com; Dong,
>>Eddie; Jiang, Yunhong; Dave Winchell
>>Subject: Re: [Xen-devel] [PATCH] Add a timer mode that
>>disables pending
>>missed ticks
>>
>>
>>Dan,
>>
>>I did some testing with the constant tsc offset SYNC method
>>(now called
>>no_missed_ticks_pending)
>>and found the error to be very high, much larger than 1 %, as
>>I recall.
>>I have not had a chance to submit a correction. I will try to
>>do it later
>>this week or the first week in January. My version of constant tsc
>>offset SYNC method
>>produces .02 % error, so I just need to port that into the
>>current code.
>>
>>The error you got for both of those kernels is what I would expect
>>for the default mode, delay_for_missed_ticks.
>>
>>I'll let Keir answer on how to set the time mode.
>>
>>Regards,
>>Dave
>>
>>Dan Magenheimer wrote:
>>
>>
>>
>>>Anyone make measurements on the final patch?
>>>
>>>I just ran a 64-bit RHEL5.1 pvm kernel and saw a loss of
>>>
>>>
>>about 0.2% with no load. This was xen-unstable tip today
>>with no options specified. 32-bit was about 0.01%.
>>
>>
>>>I think I missed something... how do I run the various
>>>
>>>
>>accounting choices and which ones are known to be appropriate
>>for which kernels?
>>
>>
>>>Thanks,
>>>Dan
>>>
>>>
>>>
>>>
>>>
>>>>-----Original Message-----
>>>>From: xen-devel-bounces@lists.xensource.com
>>>>[mailto:xen-devel-bounces@lists.xensource.com]On Behalf Of
>>>>
>>>>
>>Keir Fraser
>>
>>
>>>>Sent: Thursday, December 06, 2007 4:57 AM
>>>>To: Dave Winchell
>>>>Cc: Shan, Haitao; xen-devel@lists.xensource.com; Dong, Eddie; Jiang,
>>>>Yunhong
>>>>Subject: Re: [Xen-devel] [PATCH] Add a timer mode that
>>>>disables pending
>>>>missed ticks
>>>>
>>>>
>>>>Please take a look at xen-unstable changeset 16545.
>>>>
>>>>-- Keir
>>>>
>>>>On 26/11/07 20:57, "Dave Winchell"
>>>>
>>>>
>><dwinchell@virtualiron.com> wrote:
>>
>>
>>>>
>>>>
>>>>
>>>>>Keir,
>>>>>
>>>>>The accuracy data I've collected for i/o loads for the
>>>>>various time protocols follows. In addition, the data
>>>>>for cpu loads is shown.
>>>>>
>>>>>The loads labeled cpu and i/o-8 are on an 8 processor AMD box.
>>>>>Two guests, red hat and sles 64 bit, 8 vcpu each.
>>>>>The cpu load is usex -e36 on each guest.
>>>>>(usex is available at http://people.redhat.com/anderson/usex.)
>>>>>i/o load is 8 instances of dd if=/dev/hda6 of=/dev/null.
>>>>>
>>>>>The loads labeled i/o-32 are 32 instances of dd.
>>>>>Also, these are run on 4 cpu AMD box.
>>>>>In addition, there is an idle rh-32bit guest.
>>>>>All three guests are 8vcpu.
>>>>>
>>>>>The loads labeled i/o-4/32 are the same as i/o-32
>>>>>except that the redhat-64 guest has 4 instances of dd.
>>>>>
>>>>>Date Duration Protocol sles, rhat error load
>>>>>
>>>>>11/07 23 hrs 40 min ASYNC -4.96 sec, +4.42 sec -.006%, +.005% cpu
>>>>>11/09 3 hrs 19 min ASYNC -.13 sec, +1.44 sec, -.001%, +.012% cpu
>>>>>
>>>>>11/08 2 hrs 21 min SYNC -.80 sec, -.34 sec, -.009%, -.004% cpu
>>>>>11/08 1 hr 25 min SYNC -.24 sec, -.26 sec, -.005%, -.005% cpu
>>>>>11/12 65 hrs 40 min SYNC -18 sec, -8 sec, -.008%, -.003% cpu
>>>>>
>>>>>11/08 28 min MIXED -.75 sec, -.67 sec -.045%, -.040% cpu
>>>>>11/08 15 hrs 39 min MIXED -19. sec,-17.4 sec, -.034%, -.031% cpu
>>>>>
>>>>>
>>>>>11/14 17 hrs 17 min ASYNC -6.1 sec,-55.7 sec, -.01%, -.09% i/o-8
>>>>>11/15 2 hrs 44 min ASYNC -1.47 sec,-14.0 sec, -.015% -.14% i/o-8
>>>>>
>>>>>11/13 15 hrs 38 min SYNC -9.7 sec,-12.3 sec, -.017%, -.022% i/o-8
>>>>>11/14 48 min SYNC - .46 sec, - .48 sec, -.017%, -.018% i/o-8
>>>>>
>>>>>11/14 4 hrs 2 min MIXED -2.9 sec, -4.15 sec, -.020%, -.029% i/o-8
>>>>>11/20 16 hrs 2 min MIXED -13.4 sec,-18.1 sec, -.023%, -.031% i/o-8
>>>>>
>>>>>
>>>>>
>>>>>11/21 28 min MIXED -2.01 sec, -.67 sec, -.12%, -.04% i/o-32
>>>>>11/21 2 hrs 25 min SYNC -.96 sec, -.43 sec, -.011%, -.005% i/o-32
>>>>>11/21 40 min ASYNC -2.43 sec, -2.77 sec -.10%, -.11% i/o-32
>>>>>
>>>>>11/26 113 hrs 46 min MIXED -297. sec, 13. sec -.07%, .003% i/o-4/32
>>>>>11/26 4 hrs 50 min SYNC -3.21 sec, 1.44 sec, -.017%, .01% i/o-4/32
>>>>>
>>>>>
>>>>>Overhead measurements:
>>>>>
>>>>>Progress in terms of number of passes through a fixed
>>>>>
>>>>>
>>>>>
>>>>>
>>>>system workload
>>>>
>>>>
>>>>
>>>>
>>>>>on an 8 vcpu red hat with an 8 vcpu sles idle.
>>>>>The workload was usex -b48.
>>>>>
>>>>>
>>>>>ASYNC 167 min 145 passes .868 passes/min
>>>>>SYNC 167 min 144 passes .862 passes/min
>>>>>SYNC 1065 min 919 passes .863 passes/min
>>>>>MIXED 221 min 196 passes .887 passes/min
>>>>>
>>>>>
>>>>>Conclusions:
>>>>>
>>>>>The only protocol which meets the .05% accuracy requirement for ntp
>>>>>tracking under the loads
>>>>>above is the SYNC protocol. The worst case accuracies for
>>>>>
>>>>>
>>>>>
>>>>>
>>>>SYNC, MIXED,
>>>>
>>>>
>>>>
>>>>
>>>>>and ASYNC
>>>>>are .022%, .12%, and .14%, respectively.
>>>>>
>>>>>We could reduce the cost of the SYNC method by only
>>>>>
>>>>>
>>>>>
>>>>>
>>>>scheduling the extra
>>>>
>>>>
>>>>
>>>>
>>>>>wakeups if a certain number
>>>>>of ticks are missed.
>>>>>
>>>>>Regards,
>>>>>Dave
>>>>>
>>>>>Keir Fraser wrote:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>On 9/11/07 19:22, "Dave Winchell"
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>><dwinchell@virtualiron.com> wrote:
>>>>
>>>>
>>>>
>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>>Since I had a high error (~.03%) for the ASYNC method a
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>couple of days ago,
>>>>
>>>>
>>>>
>>>>
>>>>>>>I ran another ASYNC test. I think there may have been something
>>>>>>>wrong with the code I used a couple of days ago for
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>ASYNC. It may have been
>>>>
>>>>
>>>>
>>>>
>>>>>>>missing the immediate delivery of interrupt after context
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>switch in.
>>>>
>>>>
>>>>
>>>>
>>>>>>>My results indicate that either SYNC or ASYNC give
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>acceptable accuracy,
>>>>
>>>>
>>>>
>>>>
>>>>>>>each running consistently around or under .01%. MIXED has
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>a fairly high
>>>>
>>>>
>>>>
>>>>
>>>>>>>error of
>>>>>>>greater than .03%. Probably too close to .05% ntp
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>threshold for comfort.
>>>>
>>>>
>>>>
>>>>
>>>>>>>I don't have an overnight run with SYNC. I plan to leave
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>SYNC running
>>>>
>>>>
>>>>
>>>>
>>>>>>>over the weekend. If you'd rather I can leave MIXED
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>running instead.
>>>>
>>>>
>>>>
>>>>
>>>>>>>It may be too early to pick the protocol and I can run
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>more overnight tests
>>>>
>>>>
>>>>
>>>>
>>>>>>>next week.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>I'm a bit worried about any unwanted side effects of the
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>SYNC+run_timer
>>>>
>>>>
>>>>
>>>>
>>>>>>approach -- e.g., whether timer wakeups will cause higher
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>system-wide CPU
>>>>
>>>>
>>>>
>>>>
>>>>>>contention. I find it easier to think through the
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>implications of ASYNC. I'm
>>>>
>>>>
>>>>
>>>>
>>>>>>surprised that MIXED loses time, and is less accurate than
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>ASYNC. Perhaps it
>>>>
>>>>
>>>>
>>>>
>>>>>>delivers more timer interrupts than the other approaches,
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>and each interrupt
>>>>
>>>>
>>>>
>>>>
>>>>>>event causes a small accumulated error?
>>>>>>
>>>>>>Overall I would consider MIXED and ASYNC as favourites and
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>if the latter is
>>>>
>>>>
>>>>
>>>>
>>>>>>actually more accurate then I can simply revert the changeset that
>>>>>>implemented MIXED.
>>>>>>
>>>>>>Perhaps rather than running more of the same workloads you
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>could try idle
>>>>
>>>>
>>>>
>>>>
>>>>>>VCPUs and I/O bound VCPUs (e.g., repeated large disc reads
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>to /dev/null)? We
>>>>
>>>>
>>>>
>>>>
>>>>>>don't have any data on workloads that aren't CPU bound, so
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>that's really an
>>>>
>>>>
>>>>
>>>>
>>>>>>obvious place to put any further effort imo.
>>>>>>
>>>>>>-- Keir
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>_______________________________________________
>>>>Xen-devel mailing list
>>>>Xen-devel@lists.xensource.com
>>>>http://lists.xensource.com/xen-devel
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
>>
>
>
>
[-- Attachment #2: p.1.04.sync.time --]
[-- Type: text/plain, Size: 1445 bytes --]
diff -r cfdbdca5b831 xen/arch/x86/hvm/vpt.c
--- a/xen/arch/x86/hvm/vpt.c Thu Dec 06 15:36:07 2007 +0000
+++ b/xen/arch/x86/hvm/vpt.c Fri Jan 04 17:58:16 2008 -0500
@@ -58,7 +58,7 @@ static void pt_process_missed_ticks(stru
missed_ticks = missed_ticks / (s_time_t) pt->period + 1;
if ( mode_is(pt->vcpu->domain, no_missed_ticks_pending) )
- pt->do_not_freeze = !pt->pending_intr_nr;
+ pt->do_not_freeze = 1;
else
pt->pending_intr_nr += missed_ticks;
pt->scheduled += missed_ticks * pt->period;
@@ -127,7 +127,12 @@ static void pt_timer_fn(void *data)
pt_lock(pt);
- pt->pending_intr_nr++;
+ if ( mode_is(pt->vcpu->domain, no_missed_ticks_pending) ) {
+ pt->pending_intr_nr = 1;
+ pt->do_not_freeze = 0;
+ }
+ else
+ pt->pending_intr_nr++;
if ( !pt->one_shot )
{
@@ -221,8 +226,6 @@ void pt_intr_post(struct vcpu *v, struct
return;
}
- pt->do_not_freeze = 0;
-
if ( pt->one_shot )
{
pt->enabled = 0;
@@ -235,6 +238,10 @@ void pt_intr_post(struct vcpu *v, struct
pt->last_plt_gtime = hvm_get_guest_time(v);
pt->pending_intr_nr = 0; /* 'collapse' all missed ticks */
}
+ else if ( mode_is(v->domain, no_missed_ticks_pending) ) {
+ pt->pending_intr_nr--;
+ pt->last_plt_gtime = hvm_get_guest_time(v);
+ }
else
{
pt->last_plt_gtime += pt->period_cycles;
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
next prev parent reply other threads:[~2008-01-04 23:24 UTC|newest]
Thread overview: 78+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-30 14:28 [PATCH] Add a timer mode that disables pending missed ticks Shan, Haitao
2007-10-30 16:12 ` Keir Fraser
2007-10-30 21:16 ` Dave Winchell
2007-10-31 7:09 ` Keir Fraser
2007-11-01 21:14 ` Dave Winchell
2007-11-01 21:21 ` Dave Winchell
2007-11-02 9:40 ` Keir Fraser
2007-11-02 15:51 ` Dave Winchell
2007-11-02 16:14 ` Keir Fraser
2007-11-02 16:35 ` Keir Fraser
2007-11-02 18:05 ` Dave Winchell
2007-11-03 21:17 ` Dave Winchell
2007-11-03 22:31 ` Keir Fraser
2007-11-05 14:36 ` Dave Winchell
2007-11-07 14:39 ` Dave Winchell
2007-11-07 14:39 ` Keir Fraser
2007-11-07 16:23 ` Dave Winchell
2007-11-07 17:10 ` Keir Fraser
2007-11-07 17:29 ` Keir Fraser
2007-11-07 17:47 ` Keir Fraser
2007-11-07 19:38 ` Dave Winchell
2007-11-08 8:07 ` Keir Fraser
2007-11-08 14:43 ` Dave Winchell
2007-11-08 14:53 ` Keir Fraser
2007-11-08 15:08 ` Dave Winchell
2007-11-09 19:22 ` Dave Winchell
2007-11-10 10:55 ` Keir Fraser
2007-11-12 15:37 ` Dave Winchell
2007-11-26 20:57 ` Dave Winchell
2007-12-06 11:57 ` Keir Fraser
2007-12-19 18:57 ` Dan Magenheimer
2007-12-19 19:32 ` Dave Winchell
2008-01-03 22:57 ` Dan Magenheimer
2008-01-03 23:24 ` Dave Winchell
2008-01-04 23:24 ` Dave Winchell [this message]
2008-01-08 14:33 ` Keir Fraser
2008-01-09 16:53 ` Dave Winchell
2008-01-09 17:19 ` Dan Magenheimer
2008-01-09 19:14 ` Keir Fraser
2008-01-25 23:50 ` Dan Magenheimer
2008-01-27 21:21 ` Dave Winchell
2008-01-28 0:29 ` Dan Magenheimer
2008-01-28 15:21 ` Dave Winchell
2008-01-29 22:34 ` Dan Magenheimer
2008-01-30 15:25 ` Dave Winchell
2008-01-30 21:04 ` Deepak Patel
2008-01-30 21:44 ` Dave Winchell
2008-02-01 22:31 ` Dan Magenheimer
2008-02-04 20:07 ` Dave Winchell
2008-02-08 21:21 ` Dave Winchell
2008-02-11 16:52 ` Dave Winchell
2008-02-14 15:59 ` Dave Winchell
2008-02-14 16:21 ` Dan Magenheimer
2008-02-14 17:55 ` Dave Winchell
2008-02-15 16:46 ` Dan Magenheimer
2008-02-15 17:28 ` Dave Winchell
2008-02-19 15:26 ` Dave Winchell
2008-02-19 17:55 ` Dan Magenheimer
2008-02-19 19:29 ` Keir Fraser
2008-02-19 20:50 ` Dave Winchell
2008-02-19 23:38 ` Dan Magenheimer
2008-02-20 23:40 ` Dan Magenheimer
2008-02-25 16:42 ` Dan Magenheimer
2008-02-25 20:01 ` (progress on hpet accuracy) and " Dave Winchell
2008-02-26 8:26 ` Keir Fraser
2008-02-26 14:45 ` Dave Winchell
2008-02-26 14:56 ` Keir Fraser
2008-02-26 15:49 ` Dave Winchell
2008-03-05 15:06 ` Dave Winchell
2008-03-05 15:20 ` Keir Fraser
2008-03-05 17:25 ` Dave Winchell
2008-03-05 17:21 ` Keir Fraser
2008-03-05 17:42 ` Dave Winchell
2008-03-05 17:53 ` Dan Magenheimer
2008-03-06 23:36 ` Dan Magenheimer
2007-12-19 19:40 ` Dave Winchell
2007-11-08 14:57 ` Dave Winchell
2007-10-31 3:10 ` Shan, Haitao
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=477EC012.6040206@virtualiron.com \
--to=dwinchell@virtualiron.com \
--cc=Keir.Fraser@cl.cam.ac.uk \
--cc=dan.magenheimer@oracle.com \
--cc=xen-devel@lists.xensource.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 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.