Remove the leap second handling from second_overflow(), which doesn't has to check for it every second anymore. With CONFIG_NO_HZ this also makes sure the leap second is handled close to the full second. Additionally this makes it possible to abort a leap second properly by resetting the STA_INS/STA_DEL status bits. Signed-off-by: Roman Zippel <zippel@linux-m68k.org> --- include/linux/clocksource.h | 2 include/linux/timex.h | 1 kernel/time/ntp.c | 133 +++++++++++++++++++++++++++++--------------- kernel/time/timekeeping.c | 4 - 4 files changed, 95 insertions(+), 45 deletions(-) Index: linux-2.6/include/linux/timex.h =================================================================== --- linux-2.6.orig/include/linux/timex.h 2008-03-13 10:32:07.000000000 +0100 +++ linux-2.6/include/linux/timex.h 2008-03-13 10:33:24.000000000 +0100 @@ -210,6 +210,7 @@ extern long time_esterror; /* estimated extern long time_adjust; /* The amount of adjtime left */ +extern void ntp_init(void); extern void ntp_clear(void); /** Index: linux-2.6/kernel/time/ntp.c =================================================================== --- linux-2.6.orig/kernel/time/ntp.c 2008-03-13 10:32:07.000000000 +0100 +++ linux-2.6/kernel/time/ntp.c 2008-03-13 10:33:24.000000000 +0100 @@ -16,6 +16,7 @@ #include <linux/hrtimer.h> #include <linux/capability.h> #include <linux/math64.h> +#include <linux/clocksource.h> #include <asm/timex.h> /* @@ -26,6 +27,8 @@ unsigned long tick_nsec; /* ACTHZ peri u64 tick_length; static u64 tick_length_base; +static struct hrtimer leap_timer; + #define MAX_TICKADJ 500 /* microsecs */ #define MAX_TICKADJ_SCALED (((u64)(MAX_TICKADJ * NSEC_PER_USEC) << \ NTP_SCALE_SHIFT) / NTP_INTERVAL_FREQ) @@ -120,64 +123,70 @@ void ntp_clear(void) } /* - * this routine handles the overflow of the microsecond field - * - * The tricky bits of code to handle the accurate ...
Instead of exporting the clocksource making it global, could you use a timekeeping_insert/remove_second() style interface? That would help remove the xtime/wall_to_monotonic references in ntp.c as well, cleaning up things nicely. thanks -john --
Hi, Sounds good. bye, Roman --
On Sat, 15 Mar 2008 04:18:39 +0100 (CET) It sounds like a few updates are in the pipeline, but I merged this series as-is into -mm. I'll normally push ntp changes through Thomas's git-hrt tree, however this patch series has dependencies upon at least introduce-explicit-signed-unsigned-64bit-divide.patch convert-a-few-do_div-user.patch rename-div64_64-to-div64_u64.patch rename-div64_64-to-div64_u64-mm.patch remove-div_long_long_rem.patch so they can't go into git-hrt immediately. The idealised algorithm is - 2.6.26 opens - Thomas merges git-hrt - I merge the above patches - I then send these ntp patches to Thomas - He merges them into git-hrt - He does another git-hrt -> Linus merge And that's all OK, but various lags might cause us to miss the merge window, as I merge the -mm stuff last, and some git-tree maintainers are dawdlers. So if Thomas wants to ack these I can merge them directly late in the 2.6.26 merge window. --
Fine for me either way. Thanks, tglx --
| Adrian Bunk | If you want me to quit I will quit |
| Marc Perkel | AMD Quad Core clock problem? |
| Fred Tyler | Slow, persistent memory leak in 2.6.20 |
| Rafał Bilski | Re: cpufreq longhaul locks up |
git: | |
| Pietro Mascagni | GIT vs Other: Need argument |
| Jon Smirl | ! [rejected] master -> master (non-fast forward) |
| Theodore Tso | Re: Git/Mercurial interoperability (and what about bzr?) (was: Re: [VOTE] git vers... |
| cte | linking libgit.a in C++ projects |
| qw er | OpenBSD sucks |
| GVG GVG | ssh_exchange_identification: Connection closed by remote host |
| Andrei Pirvan | apache 1.3.29 + PHP 5.2.6 on OpenBSD 4.4 |
| STeve Andre' | Re: Perpetually Current |
| Johann Baudy | Packet mmap: TX RING and zero copy |
| Herbert Xu | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| PJ Waskiewicz | [ANNOUNCE] ixgbe: Data Center Bridging (DCB) support for ixgbe |
| Matt Mackall | [PATCH] Stop scaring users with "treason uncloaked!" |
