[asterisk-bugs] [Zaptel 0010314]: [patch] Merged in support for high resolution timers in kernel >=2.6.16

noreply at bugs.digium.com noreply at bugs.digium.com
Tue Aug 14 13:19:47 CDT 2007


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=10314 
====================================================================== 
Reported By:                darren1713
Assigned To:                
====================================================================== 
Project:                    Zaptel
Issue ID:                   10314
Category:                   ztdummy
Reproducibility:            always
Severity:                   feature
Priority:                   normal
Status:                     new
Zaptel Version:              SVN 
SVN Branch (only for SVN checkouts, not tarball releases): N/A  
SVN Revision (number only!): 2770 
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             07-26-2007 18:36 CDT
Last Modified:              08-14-2007 13:19 CDT
====================================================================== 
Summary:                    [patch] Merged in support for high resolution timers
in kernel >=2.6.16
Description: 
The new high resolution timer in the kernel generates very accurate
periodic timing. Just using the kernel based timing gets these sorts of
results from ztdummy (99.999992% avg):

......
8192 samples in 8192.000000 sample intervals 100.000000%
8192 samples in 8192.008000 sample intervals 99.999908%
--- Results after 123 passes ---
Best: 100.000000 -- Worst: 99.999512 -- Average: 99.999992

The high resolution timer in ztdummy is only built if it's supported and
enabled in the kernel, and will continue to use the RTC timing if the high
resolution timers are not available. 

Specifically, CONFIG_HIGH_RES_TIMERS needs to be enabled (Processor type
and features -> High Resolution Timer Support), and optionally, (Processor
type and features -> HPET Timer Support) provides a better clock source.

There should be no side effects to this, since it's the new kernel
timers.

Adding an option into the "make menuselect" to force RTC instead if they
are both available would be a good addition. Configs/Makefiles are not my
fortay, so this would be better for someone else to do.

====================================================================== 

---------------------------------------------------------------------- 
 darren1713 - 08-14-07 13:19  
---------------------------------------------------------------------- 
As a note, I'm getting better than 99.9999% accuracy with zttest. This
doesn't fix any timing related concerns with zttest though. I hope that all
of this is actually resulting in better timing. It would be amazing if
someone could hook up an external digital IO and actually time this on a
scope or logic analyzer.

Here's my config/results:

model name      : Intel(R) Xeon(R) CPU            3050  @ 2.13GHz
cpu MHz         : 2133.452
cache size      : 2048 KB
bogomips        : 4268.57

BIG NOTE HERE -> My kernel is patched with the Xenomai Realtime kernel
enhancements. This moves timed interrupts into a layer above the kernel,
and is probably why no matter what I load my system down with, from 100%
cpu usage, maximum disk io, and network traffic, and NOTHING affects the
timing accuracy. The relevant options in the rest of my kernel are:

* High Resolution Timer Support 
* HPET Timer Support
Preemption Model (No Forced Preemption (Server))
* Preempt The Big Kernel Lock
Timer frequency (250 HZ)

Results:

8192 samples in 8191.968000 sample intervals 99.999603%
8192 samples in 8192.000000 sample intervals 100.000000%
8192 samples in 8192.000000 sample intervals 100.000000%
8192 samples in 8192.000000 sample intervals 100.000000%
8192 samples in 8192.000000 sample intervals 100.000000%
8192 samples in 8192.000000 sample intervals 100.000000%
8192 samples in 8192.000000 sample intervals 100.000000%
8192 samples in 8192.000000 sample intervals 100.000000%
8192 samples in 8192.000000 sample intervals 100.000000%
8192 samples in 8192.000000 sample intervals 100.000000%
8192 samples in 8192.000000 sample intervals 100.000000%
8192 samples in 8192.000000 sample intervals 100.000000%
8192 samples in 8192.000000 sample intervals 100.000000%
8192 samples in 8192.000000 sample intervals 100.000000%
8192 samples in 8192.000000 sample intervals 100.000000%
--- Results after 15 passes ---
Best: 100.000000 -- Worst: 99.999603 -- Average: 99.999976 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
08-14-07 13:19  darren1713     Note Added: 0068839                          
======================================================================




More information about the asterisk-bugs mailing list