<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/include/linux/timex.h, branch v3.4.67</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.4.67</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.4.67'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2012-03-23T02:43:43Z</updated>
<entry>
<title>ntp: Fix leap-second hrtimer livelock</title>
<updated>2012-03-23T02:43:43Z</updated>
<author>
<name>John Stultz</name>
<email>john.stultz@linaro.org</email>
</author>
<published>2012-03-15T20:04:03Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=6b43ae8a619d17c4935c3320d2ef9e92bdeed05d'/>
<id>urn:sha1:6b43ae8a619d17c4935c3320d2ef9e92bdeed05d</id>
<content type='text'>
Since commit 7dffa3c673fbcf835cd7be80bb4aec8ad3f51168 the ntp
subsystem has used an hrtimer for triggering the leapsecond
adjustment. However, this can cause a potential livelock.

Thomas diagnosed this as the following pattern:
CPU 0                                                    CPU 1
do_adjtimex()
  spin_lock_irq(&amp;ntp_lock);
    process_adjtimex_modes();				 timer_interrupt()
      process_adj_status();                                do_timer()
        ntp_start_leap_timer();                             write_lock(&amp;xtime_lock);
          hrtimer_start();                                  update_wall_time();
             hrtimer_reprogram();                            ntp_tick_length()
               tick_program_event()                            spin_lock(&amp;ntp_lock);
                 clockevents_program_event()
		   ktime_get()
                     seq = req_seqbegin(xtime_lock);

This patch tries to avoid the problem by reverting back to not using
an hrtimer to inject leapseconds, and instead we handle the leapsecond
processing in the second_overflow() function.

The downside to this change is that on systems that support highres
timers, the leap second processing will occur on a HZ tick boundary,
(ie: ~1-10ms, depending on HZ)  after the leap second instead of
possibly sooner (~34us in my tests w/ x86_64 lapic).

This patch applies on top of tip/timers/core.

CC: Sasha Levin &lt;levinsasha928@gmail.com&gt;
CC: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reported-by: Sasha Levin &lt;levinsasha928@gmail.com&gt;
Diagnoised-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Tested-by: Sasha Levin &lt;levinsasha928@gmail.com&gt;
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
</content>
</entry>
<entry>
<title>ntp: Access tick_length variable via ntp_tick_length()</title>
<updated>2012-01-27T03:44:23Z</updated>
<author>
<name>John Stultz</name>
<email>john.stultz@linaro.org</email>
</author>
<published>2011-11-14T21:18:07Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ea7cf49a7633c2b70125f59b4e3553d9181cb15d'/>
<id>urn:sha1:ea7cf49a7633c2b70125f59b4e3553d9181cb15d</id>
<content type='text'>
Currently the NTP managed tick_length value is accessed globally,
in preparations for locking cleanups, make sure it is accessed via
a function and mark it as static.

CC: Thomas Gleixner &lt;tglx@linutronix.de&gt;
CC: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
CC: Richard Cochran &lt;richardcochran@gmail.com&gt;
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
</content>
</entry>
<entry>
<title>ntp: Cleanup timex.h</title>
<updated>2012-01-27T03:44:20Z</updated>
<author>
<name>John Stultz</name>
<email>john.stultz@linaro.org</email>
</author>
<published>2011-11-14T21:06:21Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=8357929e6ae3661d5a3a7378a717f29873ea18c6'/>
<id>urn:sha1:8357929e6ae3661d5a3a7378a717f29873ea18c6</id>
<content type='text'>
Move ntp_sycned to ntp.c and mark time_status as static.
Also yank function declaration for non-existant function.

CC: Thomas Gleixner &lt;tglx@linutronix.de&gt;
CC: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
CC: Richard Cochran &lt;richardcochran@gmail.com&gt;
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
</content>
</entry>
<entry>
<title>ntp: Add ADJ_SETOFFSET mode bit</title>
<updated>2011-02-02T14:28:18Z</updated>
<author>
<name>Richard Cochran</name>
<email>richardcochran@gmail.com</email>
</author>
<published>2011-02-01T13:52:20Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=094aa1881fdc1b8889b442eb3511b31f3ec2b762'/>
<id>urn:sha1:094aa1881fdc1b8889b442eb3511b31f3ec2b762</id>
<content type='text'>
This patch adds a new mode bit into the timex structure. When set, the bit
instructs the kernel to add the given time value to the current time.

Signed-off-by: Richard Cochran &lt;richard.cochran@omicron.at&gt;
Acked-by: John Stultz &lt;johnstul@us.ibm.com&gt;
LKML-Reference: &lt;20110201134320.688829863@linutronix.de&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>ntp: add hardpps implementation</title>
<updated>2011-01-13T16:03:20Z</updated>
<author>
<name>Alexander Gordeev</name>
<email>lasaine@lvk.cs.msu.su</email>
</author>
<published>2011-01-13T01:00:56Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=025b40abe715d638e60516a657d354e8560c1a85'/>
<id>urn:sha1:025b40abe715d638e60516a657d354e8560c1a85</id>
<content type='text'>
This commit adds hardpps() implementation based upon the original one from
the NTPv4 reference kernel code from David Mills.  However, it is highly
optimized towards very fast syncronization and maximum stickness to PPS
signal.  The typical error is less then a microsecond.

To make it sync faster I had to throw away exponential phase filter so
that the full phase offset is corrected immediately.  Then I also had to
throw away median phase filter because it gives a bigger error itself if
used without exponential filter.

Maybe we will find an appropriate filtering scheme in the future but it's
not necessary if the signal quality is ok.

Signed-off-by: Alexander Gordeev &lt;lasaine@lvk.cs.msu.su&gt;
Acked-by: John Stultz &lt;johnstul@us.ibm.com&gt;
Cc: Rodolfo Giometti &lt;giometti@enneenne.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>ntp: Remove tickadj</title>
<updated>2010-03-23T16:19:38Z</updated>
<author>
<name>John Stultz</name>
<email>johnstul@us.ibm.com</email>
</author>
<published>2010-03-19T03:19:28Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=3d0205bd1383aa3cac93c209b7c7d03b27930195'/>
<id>urn:sha1:3d0205bd1383aa3cac93c209b7c7d03b27930195</id>
<content type='text'>
There are zero users of tickadj. So remove it.

Signed-off-by: John Stultz &lt;johnstul@us.ibm.com&gt;
LKML-Reference: &lt;1268968769-19209-2-git-send-email-johnstul@us.ibm.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>ntp: Make time_adjust static</title>
<updated>2010-03-23T16:19:37Z</updated>
<author>
<name>John Stultz</name>
<email>johnstul@us.ibm.com</email>
</author>
<published>2010-03-19T03:19:27Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e1292ba164742e3a236e407148e00300b7196906'/>
<id>urn:sha1:e1292ba164742e3a236e407148e00300b7196906</id>
<content type='text'>
Now that no arches are accessing time_adjust directly,
make it static.

Signed-off-by: John Stultz &lt;johnstul@us.ibm.com&gt;
LKML-Reference: &lt;1268968769-19209-1-git-send-email-johnstul@us.ibm.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>ntp: Make time_esterror and time_maxerror static</title>
<updated>2010-01-29T09:15:19Z</updated>
<author>
<name>john stultz</name>
<email>johnstul@us.ibm.com</email>
</author>
<published>2010-01-28T23:02:41Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=1f5b8f8a2031ae9507eb67743cad4d424739bfff'/>
<id>urn:sha1:1f5b8f8a2031ae9507eb67743cad4d424739bfff</id>
<content type='text'>
Make time_esterror and time_maxerror static as no one uses them
outside of ntp.c
    
Signed-off-by: John Stultz &lt;johnstul@us.ibm.com&gt;
Cc: richard@rsk.demon.co.uk
LKML-Reference: &lt;1264719761.3437.47.camel@localhost.localdomain&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;

</content>
</entry>
<entry>
<title>Merge branches 'timers-for-linus-ntp' and 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip</title>
<updated>2009-12-09T03:30:19Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2009-12-09T03:30:19Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=2b876f95d03e226394b5d360c86127cbefaf614b'/>
<id>urn:sha1:2b876f95d03e226394b5d360c86127cbefaf614b</id>
<content type='text'>
* 'timers-for-linus-ntp' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  ntp: Provide compability defines (You say MOD_NANO, I say ADJ_NANO)

* 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  genirq: do not execute DEBUG_SHIRQ when irq setup failed
</content>
</entry>
<entry>
<title>time: Implement logarithmic time accumulation</title>
<updated>2009-10-05T11:51:48Z</updated>
<author>
<name>john stultz</name>
<email>johnstul@us.ibm.com</email>
</author>
<published>2009-10-02T23:17:53Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=a092ff0f90cae22b2ac8028ecd2c6f6c1a9e4601'/>
<id>urn:sha1:a092ff0f90cae22b2ac8028ecd2c6f6c1a9e4601</id>
<content type='text'>
Accumulating one tick at a time works well unless we're using NOHZ.
Then it can be an issue, since we may have to run through the loop
a few thousand times, which can increase timer interrupt caused
latency.

The current solution was to accumulate in half-second intervals
with NOHZ. This kept the number of loops down, however it did
slightly change how we make NTP adjustments. While not an issue
with NTPd users, as NTPd makes adjustments over a longer period of
time, other adjtimex() users have noticed the half-second
granularity with which we can apply frequency changes to the clock.

For instance, if a application tries to apply a 100ppm frequency
correction for 20ms to correct a 2us offset, with NOHZ they either
get no correction, or a 50us correction.

Now, there will always be some granularity error for applying
frequency corrections. However with users sensitive to this error
have seen a 50-500x increase with NOHZ compared to running without
NOHZ.

So I figured I'd try another approach then just simply increasing
the interval. My approach is to consume the time interval
logarithmically. This reduces the number of times through the loop
needed keeping latency down, while still preserving the original
granularity error for adjtimex() changes.

Further, this change allows us to remove the xtime_cache code
(patch to follow), as xtime is always within one tick of the
current time, instead of the half-second updates it saw before.

An earlier version of this patch has been shipping to x86 users in
the RedHat MRG releases for awhile without issue, but I've reworked
this version to be even more careful about avoiding possible
overflows if the shift value gets too large.

Signed-off-by: John Stultz &lt;johnstul@us.ibm.com&gt;
Acked-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: John Kacur &lt;jkacur@redhat.com&gt;
Cc: Clark Williams &lt;williams@redhat.com&gt;
Cc: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
LKML-Reference: &lt;1254525473.7741.88.camel@localhost.localdomain&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
</feed>
