Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 317099 Details for
Bug 462410
[BUG]Loosing time with divider=10 option.
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Fine tune the ACT_HZ value when divider= is enabled.
tick_nsec_tune.patch (text/plain), 3.52 KB, created by
Alok Kataria
on 2008-09-18 17:15:27 UTC
(
hide
)
Description:
Fine tune the ACT_HZ value when divider= is enabled.
Filename:
MIME Type:
Creator:
Alok Kataria
Created:
2008-09-18 17:15:27 UTC
Size:
3.52 KB
patch
obsolete
>[EXPERIMENTAL PATCH] > >Fine tune the ACT_HZ value when divider= is enabled. > >From: Alok N Kataria <akataria@vmware.com> > >As noted by Garret, there is some error in calculation if divider= option is >passed. The LOGICAL_LATCH value which is based on HZ is calculated to 1193, >and the LATCH value (based on REAL_HZ) is calculated to 11932, with divider=10. > >We use the LATCH value to program the PIT period, but TICK_NSEC (which is >used to adjust time of day based on jiffies advancement) is computed based >computed based on LOGICAL_LATCH. > >As a result we loose about 2 PIT ticks every interrupt. This is reflected >in TOD going loosing time at a constant rate of 166ppm. >Over a run of 5hrs we have seen that TOD looses about 3 sec of time. > >The patch below fixes it by fine tuning the ACTHZ value and the TICK_NSEC >value. The implementation of this proved difficult as TICK_NSEC which >originally was a constant, is used at lot of places to initialize a value >or in #ifdefine's. Changing all of these places made the patch very intrusive. >Instead I know define ACTHZ_FINE which is used to calculate TICK_NSEC_FINE. > >This value (TICK_NSEC_FINE) is used in places where TICK_NSEC is used to compute >TOD. > >Analysed-by: Garrett Smith <garrett@vmware.com> >Signed-off-by: Alok N Kataria <akataria@vmware.com> >--- > > include/linux/jiffies.h | 2 ++ > kernel/time/jiffies.c | 4 ++-- > kernel/timer.c | 3 +++ > 3 files changed, 7 insertions(+), 2 deletions(-) > > >diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h >index 72a26e7..bef9f48 100644 >--- a/include/linux/jiffies.h >+++ b/include/linux/jiffies.h >@@ -63,11 +63,13 @@ extern unsigned int tick_divider; > > /* HZ is the requested value. ACTHZ is actual HZ ("<< 8" is for accuracy) */ > #define ACTHZ (SH_DIV (CLOCK_TICK_RATE, LOGICAL_LATCH, 8)) >+#define ACTHZ_FINE ((SH_DIV (CLOCK_TICK_RATE, LATCH, 8)) * tick_divider) > > #define ACTHZ_HPET (SH_DIV (HPET_TICK_RATE, LOGICAL_LATCH_HPET, 8)) > > /* TICK_NSEC is the time between ticks in nsec assuming real ACTHZ */ > #define TICK_NSEC (SH_DIV (1000000UL * 1000, ACTHZ, 8)) >+#define TICK_NSEC_FINE (SH_DIV (1000000UL * 1000, ACTHZ_FINE, 8)) > > #define TICK_NSEC_HPET (SH_DIV(1000000UL * 1000, ACTHZ_HPET, 8)) > >diff --git a/kernel/time/jiffies.c b/kernel/time/jiffies.c >index 126bb30..2275735 100644 >--- a/kernel/time/jiffies.c >+++ b/kernel/time/jiffies.c >@@ -34,7 +34,7 @@ > * requested HZ value. It is also not reccomended > * for "tick-less" systems. > */ >-#define NSEC_PER_JIFFY ((u32)((((u64)NSEC_PER_SEC)<<8)/ACTHZ)) >+#define NSEC_PER_JIFFY ((u32)((((u64)NSEC_PER_SEC)<<8)/ACTHZ_FINE)) > > /* Since jiffies uses a simple NSEC_PER_JIFFY multiplier > * conversion, the .shift value could be zero. However >@@ -60,13 +60,13 @@ struct clocksource clocksource_jiffies = { > .rating = 0, /* lowest rating*/ > .read = jiffies_read, > .mask = 0xffffffff, /*32bits*/ >- .mult = NSEC_PER_JIFFY << JIFFIES_SHIFT, /* details above */ > .shift = JIFFIES_SHIFT, > .is_continuous = 0, /* tick based, not free running */ > }; > > static int __init init_jiffies_clocksource(void) > { >+ clocksource_jiffies.mult = NSEC_PER_JIFFY << JIFFIES_SHIFT; > return clocksource_register(&clocksource_jiffies); > } > >diff --git a/kernel/timer.c b/kernel/timer.c >index 3eb09ed..37d49ee 100644 >--- a/kernel/timer.c >+++ b/kernel/timer.c >@@ -1092,6 +1092,9 @@ void __init timekeeping_init(void) > { > unsigned long flags; > >+#ifdef CONFIG_TICK_DIVIDER >+ tick_nsec = TICK_NSEC_FINE; >+#endif > write_seqlock_irqsave(&xtime_lock, flags); > clock = clocksource_get_next(); > clocksource_calculate_interval(clock, tick_nsec);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 462410
: 317099