<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/time, branch v3.4.19</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/kernel/time?h=v3.4.19</id>
<link rel='self' href='https://git.amat.us/linux/atom/kernel/time?h=v3.4.19'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2012-10-02T17:30:36Z</updated>
<entry>
<title>time: Move ktime_t overflow checking into timespec_valid_strict</title>
<updated>2012-10-02T17:30:36Z</updated>
<author>
<name>John Stultz</name>
<email>john.stultz@linaro.org</email>
</author>
<published>2012-09-11T19:04:19Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=9a227fcb842a03fce5b8a6da0da40f5601ec6908'/>
<id>urn:sha1:9a227fcb842a03fce5b8a6da0da40f5601ec6908</id>
<content type='text'>
commit cee58483cf56e0ba355fdd97ff5e8925329aa936 upstream

Andreas Bombe reported that the added ktime_t overflow checking added to
timespec_valid in commit 4e8b14526ca7 ("time: Improve sanity checking of
timekeeping inputs") was causing problems with X.org because it caused
timeouts larger then KTIME_T to be invalid.

Previously, these large timeouts would be clamped to KTIME_MAX and would
never expire, which is valid.

This patch splits the ktime_t overflow checking into a new
timespec_valid_strict function, and converts the timekeeping codes
internal checking to use this more strict function.

Reported-and-tested-by: Andreas Bombe &lt;aeb@debian.org&gt;
Cc: Zhouping Liu &lt;zliu@redhat.com&gt;
Cc: Ingo Molnar &lt;mingo@kernel.org&gt;
Cc: Prarit Bhargava &lt;prarit@redhat.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>time: Avoid making adjustments if we haven't accumulated anything</title>
<updated>2012-10-02T17:30:36Z</updated>
<author>
<name>John Stultz</name>
<email>john.stultz@linaro.org</email>
</author>
<published>2012-09-11T19:04:18Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=80257cbe62ea0919153c43421746269ab68473bf'/>
<id>urn:sha1:80257cbe62ea0919153c43421746269ab68473bf</id>
<content type='text'>
commit bf2ac312195155511a0f79325515cbb61929898a upstream.

If update_wall_time() is called and the current offset isn't large
enough to accumulate, avoid re-calling timekeeping_adjust which may
change the clock freq and can cause 1ns inconsistencies with
CLOCK_REALTIME_COARSE/CLOCK_MONOTONIC_COARSE.

Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
Cc: Prarit Bhargava &lt;prarit@redhat.com&gt;
Cc: Ingo Molnar &lt;mingo@kernel.org&gt;
Link: http://lkml.kernel.org/r/1345595449-34965-5-git-send-email-john.stultz@linaro.org
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>time: Improve sanity checking of timekeeping inputs</title>
<updated>2012-10-02T17:30:36Z</updated>
<author>
<name>John Stultz</name>
<email>john.stultz@linaro.org</email>
</author>
<published>2012-09-11T19:04:17Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=8e878154f5658ba93cf9bb2b491a930ec195de3d'/>
<id>urn:sha1:8e878154f5658ba93cf9bb2b491a930ec195de3d</id>
<content type='text'>
commit 4e8b14526ca7fb046a81c94002c1c43b6fdf0e9b upstream.

Unexpected behavior could occur if the time is set to a value large
enough to overflow a 64bit ktime_t (which is something larger then the
year 2262).

Also unexpected behavior could occur if large negative offsets are
injected via adjtimex.

So this patch improves the sanity check timekeeping inputs by
improving the timespec_valid() check, and then makes better use of
timespec_valid() to make sure we don't set the time to an invalid
negative value or one that overflows ktime_t.

Note: This does not protect from setting the time close to overflowing
ktime_t and then letting natural accumulation cause the overflow.

Reported-by: CAI Qian &lt;caiqian@redhat.com&gt;
Reported-by: Sasha Levin &lt;levinsasha928@gmail.com&gt;
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: Prarit Bhargava &lt;prarit@redhat.com&gt;
Cc: Zhouping Liu &lt;zliu@redhat.com&gt;
Cc: Ingo Molnar &lt;mingo@kernel.org&gt;
Link: http://lkml.kernel.org/r/1344454580-17031-1-git-send-email-john.stultz@linaro.org
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>sched: Add missing call to calc_load_exit_idle()</title>
<updated>2012-10-02T17:30:05Z</updated>
<author>
<name>Charles Wang</name>
<email>muming.wq@taobao.com</email>
</author>
<published>2012-08-20T08:02:33Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=48f0f14ffb6ff4852922994d11fbda418d40100e'/>
<id>urn:sha1:48f0f14ffb6ff4852922994d11fbda418d40100e</id>
<content type='text'>
commit 749c8814f08f12baa4a9c2812a7c6ede7d69507d upstream.

Azat Khuzhin reported high loadavg in Linux v3.6

After checking the upstream scheduler code, I found Peter's commit:

  5167e8d5417b sched/nohz: Rewrite and fix load-avg computation -- again

not fully applied, missing the call to calc_load_exit_idle().

After that idle exit in sampling window will always be calculated
to non-idle, and the load will be higher than normal.

This patch adds the missing call to calc_load_exit_idle().

Signed-off-by: Charles Wang &lt;muming.wq@taobao.com&gt;
Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Link: http://lkml.kernel.org/r/1345449754-27130-1-git-send-email-muming.wq@gmail.com
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>ntp: Fix STA_INS/DEL clearing bug</title>
<updated>2012-07-29T15:04:18Z</updated>
<author>
<name>John Stultz</name>
<email>johnstul@us.ibm.com</email>
</author>
<published>2012-07-13T05:21:50Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=fd25080998d00a94a87bf7fc9f843291db7250a6'/>
<id>urn:sha1:fd25080998d00a94a87bf7fc9f843291db7250a6</id>
<content type='text'>
commit 6b1859dba01c7d512b72d77e3fd7da8354235189 upstream.

In commit 6b43ae8a619d17c4935c3320d2ef9e92bdeed05d, I
introduced a bug that kept the STA_INS or STA_DEL bit
from being cleared from time_status via adjtimex()
without forcing STA_PLL first.

Usually once the STA_INS is set, it isn't cleared
until the leap second is applied, so its unlikely this
affected anyone. However during testing I noticed it
took some effort to cancel a leap second once STA_INS
was set.

Signed-off-by: John Stultz &lt;johnstul@us.ibm.com&gt;
Cc: Ingo Molnar &lt;mingo@kernel.org&gt;
Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: Richard Cochran &lt;richardcochran@gmail.com&gt;
Cc: Prarit Bhargava &lt;prarit@redhat.com&gt;
Link: http://lkml.kernel.org/r/1342156917-25092-2-git-send-email-john.stultz@linaro.org
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>timekeeping: Add missing update call in timekeeping_resume()</title>
<updated>2012-07-19T15:59:00Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2012-07-17T06:39:56Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=3cdeda1e763ccb2287c6ee76ece14145027653a9'/>
<id>urn:sha1:3cdeda1e763ccb2287c6ee76ece14145027653a9</id>
<content type='text'>
This is a backport of 3e997130bd2e8c6f5aaa49d6e3161d4d29b43ab0

The leap second rework unearthed another issue of inconsistent data.

On timekeeping_resume() the timekeeper data is updated, but nothing
calls timekeeping_update(), so now the update code in the timer
interrupt sees stale values.

This has been the case before those changes, but then the timer
interrupt was using stale data as well so this went unnoticed for quite
some time.

Add the missing update call, so all the data is consistent everywhere.

Reported-by: Andreas Schwab &lt;schwab@linux-m68k.org&gt;
Reported-and-tested-by: "Rafael J. Wysocki" &lt;rjw@sisk.pl&gt;
Reported-and-tested-by: Martin Steigerwald &lt;Martin@lichtvoll.de&gt;
Cc: John Stultz &lt;johnstul@us.ibm.com&gt;
Cc: Ingo Molnar &lt;mingo@kernel.org&gt;
Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;,
Cc: Prarit Bhargava &lt;prarit@redhat.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: John Stultz &lt;johnstul@us.ibm.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Prarit Bhargava &lt;prarit@redhat.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: John Stultz &lt;johnstul@us.ibm.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>timekeeping: Provide hrtimer update function</title>
<updated>2012-07-19T15:59:00Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2012-07-17T06:39:54Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=765bdc4d82fadcddfec19222a545e904633c7816'/>
<id>urn:sha1:765bdc4d82fadcddfec19222a545e904633c7816</id>
<content type='text'>
This is a backport of f6c06abfb3972ad4914cef57d8348fcb2932bc3b

To finally fix the infamous leap second issue and other race windows
caused by functions which change the offsets between the various time
bases (CLOCK_MONOTONIC, CLOCK_REALTIME and CLOCK_BOOTTIME) we need a
function which atomically gets the current monotonic time and updates
the offsets of CLOCK_REALTIME and CLOCK_BOOTTIME with minimalistic
overhead. The previous patch which provides ktime_t offsets allows us
to make this function almost as cheap as ktime_get() which is going to
be replaced in hrtimer_interrupt().

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Acked-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Acked-by: Prarit Bhargava &lt;prarit@redhat.com&gt;
Signed-off-by: John Stultz &lt;johnstul@us.ibm.com&gt;
Link: http://lkml.kernel.org/r/1341960205-56738-7-git-send-email-johnstul@us.ibm.com
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Prarit Bhargava &lt;prarit@redhat.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: John Stultz &lt;johnstul@us.ibm.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>timekeeping: Maintain ktime_t based offsets for hrtimers</title>
<updated>2012-07-19T15:58:59Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2012-07-17T06:39:52Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=7d1f07113b1b32da1eabce0dc74d9f96bbb7b90a'/>
<id>urn:sha1:7d1f07113b1b32da1eabce0dc74d9f96bbb7b90a</id>
<content type='text'>
This is a backport of 5b9fe759a678e05be4937ddf03d50e950207c1c0

We need to update the hrtimer clock offsets from the hrtimer interrupt
context. To avoid conversions from timespec to ktime_t maintain a
ktime_t based representation of those offsets in the timekeeper. This
puts the conversion overhead into the code which updates the
underlying offsets and provides fast accessible values in the hrtimer
interrupt.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: John Stultz &lt;johnstul@us.ibm.com&gt;
Reviewed-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Acked-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Acked-by: Prarit Bhargava &lt;prarit@redhat.com&gt;
Link: http://lkml.kernel.org/r/1341960205-56738-4-git-send-email-johnstul@us.ibm.com
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Prarit Bhargava &lt;prarit@redhat.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: John Stultz &lt;johnstul@us.ibm.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>timekeeping: Fix leapsecond triggered load spike issue</title>
<updated>2012-07-19T15:58:59Z</updated>
<author>
<name>John Stultz</name>
<email>johnstul@us.ibm.com</email>
</author>
<published>2012-07-17T06:39:51Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=2e947d469fba2c2036ff50a2e58a1875ab2ea6b6'/>
<id>urn:sha1:2e947d469fba2c2036ff50a2e58a1875ab2ea6b6</id>
<content type='text'>
This is a backport of 4873fa070ae84a4115f0b3c9dfabc224f1bc7c51

The timekeeping code misses an update of the hrtimer subsystem after a
leap second happened. Due to that timers based on CLOCK_REALTIME are
either expiring a second early or late depending on whether a leap
second has been inserted or deleted until an operation is initiated
which causes that update. Unless the update happens by some other
means this discrepancy between the timekeeping and the hrtimer data
stays forever and timers are expired either early or late.

The reported immediate workaround - $ data -s "`date`" - is causing a
call to clock_was_set() which updates the hrtimer data structures.
See: http://www.sheeri.com/content/mysql-and-leap-second-high-cpu-and-fix

Add the missing clock_was_set() call to update_wall_time() in case of
a leap second event. The actual update is deferred to softirq context
as the necessary smp function call cannot be invoked from hard
interrupt context.

Signed-off-by: John Stultz &lt;johnstul@us.ibm.com&gt;
Reported-by: Jan Engelhardt &lt;jengelh@inai.de&gt;
Reviewed-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Acked-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Acked-by: Prarit Bhargava &lt;prarit@redhat.com&gt;
Link: http://lkml.kernel.org/r/1341960205-56738-3-git-send-email-johnstul@us.ibm.com
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Prarit Bhargava &lt;prarit@redhat.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: John Stultz &lt;johnstul@us.ibm.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>sched/nohz: Rewrite and fix load-avg computation -- again</title>
<updated>2012-07-19T15:58:56Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>a.p.zijlstra@chello.nl</email>
</author>
<published>2012-06-22T13:52:09Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=7490d0a4cfefa16f9d8ce636eb5b2e13d2432db3'/>
<id>urn:sha1:7490d0a4cfefa16f9d8ce636eb5b2e13d2432db3</id>
<content type='text'>
commit 5167e8d5417bf5c322a703d2927daec727ea40dd upstream.

Thanks to Charles Wang for spotting the defects in the current code:

 - If we go idle during the sample window -- after sampling, we get a
   negative bias because we can negate our own sample.

 - If we wake up during the sample window we get a positive bias
   because we push the sample to a known active period.

So rewrite the entire nohz load-avg muck once again, now adding
copious documentation to the code.

Reported-and-tested-by: Doug Smythies &lt;dsmythies@telus.net&gt;
Reported-and-tested-by: Charles Wang &lt;muming.wq@gmail.com&gt;
Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Link: http://lkml.kernel.org/r/1340373782.18025.74.camel@twins
[ minor edits ]
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
</feed>
