<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/time/timekeeping.c, branch v3.19</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v3.19</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v3.19'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2014-12-10T18:13:28Z</updated>
<entry>
<title>Merge branch 'timers-2038-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip</title>
<updated>2014-12-10T18:13:28Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2014-12-10T18:13:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d82012695ef29e4e1c8153ccf43098ec8e50369e'/>
<id>urn:sha1:d82012695ef29e4e1c8153ccf43098ec8e50369e</id>
<content type='text'>
Pull more 2038 timer work from Thomas Gleixner:
 "Two more patches for the ongoing 2038 work:

   - New accessors to clock MONOTONIC and REALTIME seconds

  This is a seperate branch as Arnd has follow up work depending on
  this"

* 'timers-2038-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  timekeeping: Provide y2038 safe accessor to the seconds portion of CLOCK_REALTIME
  timekeeping: Provide fast accessor to the seconds part of CLOCK_MONOTONIC
</content>
</entry>
<entry>
<title>time: Fix sign bug in NTP mult overflow warning</title>
<updated>2014-11-25T06:18:34Z</updated>
<author>
<name>John Stultz</name>
<email>john.stultz@linaro.org</email>
</author>
<published>2014-11-25T04:35:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=cb2aa63469f81426c7406227be70b628b42f7a05'/>
<id>urn:sha1:cb2aa63469f81426c7406227be70b628b42f7a05</id>
<content type='text'>
In commit 6067dc5a8c2b ("time: Avoid possible NTP adjustment
mult overflow") a new check was added to watch for adjustments
that could cause a mult overflow.

Unfortunately the check compares a signed with unsigned value
and ignored the case where the adjustment was negative, which
causes spurious warn-ons on some systems (and seems like it
would result in problematic time adjustments there as well, due
to the early return).

Thus this patch adds a check to make sure the adjustment is
positive before we check for an overflow, and resovles the issue
in my testing.

Reported-by: Fengguang Wu &lt;fengguang.wu@intel.com&gt;
Debugged-by: pang.xunlei &lt;pang.xunlei@linaro.org&gt;
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
Link: http://lkml.kernel.org/r/1416890145-30048-1-git-send-email-john.stultz@linaro.org
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>time: Fixup comments to reflect usage of timespec64</title>
<updated>2014-11-21T19:59:59Z</updated>
<author>
<name>John Stultz</name>
<email>john.stultz@linaro.org</email>
</author>
<published>2014-11-07T21:13:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5322e4c2649844c04f480ca45572022eb684b872'/>
<id>urn:sha1:5322e4c2649844c04f480ca45572022eb684b872</id>
<content type='text'>
Fix up a few comments that weren't updated when the
functions were converted to use timespec64 structures.

Acked-by: Arnd Bergmann &lt;arnd.bergmann@linaro.org&gt;
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
</content>
</entry>
<entry>
<title>time: Expose get_monotonic_coarse64() for in-kernel uses</title>
<updated>2014-11-21T19:59:59Z</updated>
<author>
<name>John Stultz</name>
<email>john.stultz@linaro.org</email>
</author>
<published>2014-11-07T19:20:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=334334b5f577a2255e29d2352d53197d9b796511'/>
<id>urn:sha1:334334b5f577a2255e29d2352d53197d9b796511</id>
<content type='text'>
Adds a timespec64 based get_monotonic_coarse64() implementation
that can be used as we convert internal users of
get_monotonic_coarse away from using timespecs.

Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
</content>
</entry>
<entry>
<title>time: Expose getrawmonotonic64 for in-kernel uses</title>
<updated>2014-11-21T19:59:58Z</updated>
<author>
<name>John Stultz</name>
<email>john.stultz@linaro.org</email>
</author>
<published>2014-11-07T19:03:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=cdba2ec538d9843c42cac15ff4ec54dc2ac53f8a'/>
<id>urn:sha1:cdba2ec538d9843c42cac15ff4ec54dc2ac53f8a</id>
<content type='text'>
Adds a timespec64 based getrawmonotonic64() implementation
that can be used as we convert internal users of
getrawmonotonic away from using timespecs.

Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
</content>
</entry>
<entry>
<title>time: Provide y2038 safe timekeeping_inject_sleeptime() replacement</title>
<updated>2014-11-21T19:59:57Z</updated>
<author>
<name>pang.xunlei</name>
<email>pang.xunlei@linaro.org</email>
</author>
<published>2014-11-18T11:15:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=04d9089086a8231ddc69a9f3f25e971a3c1d25e6'/>
<id>urn:sha1:04d9089086a8231ddc69a9f3f25e971a3c1d25e6</id>
<content type='text'>
As part of addressing "y2038 problem" for in-kernel uses, this
patch adds timekeeping_inject_sleeptime64() using timespec64.

After this patch, timekeeping_inject_sleeptime() is deprecated
and all its call sites will be fixed using the new interface,
after that it can be removed.

NOTE: timekeeping_inject_sleeptime() is safe actually, but we
want to eliminate timespec eventually, so comes this patch.

Signed-off-by: pang.xunlei &lt;pang.xunlei@linaro.org&gt;
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
</content>
</entry>
<entry>
<title>time: Provide y2038 safe do_settimeofday() replacement</title>
<updated>2014-11-21T19:59:57Z</updated>
<author>
<name>pang.xunlei</name>
<email>pang.xunlei@linaro.org</email>
</author>
<published>2014-11-18T11:15:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=21f7eca555ad14e7c7b2cb59a6c6252e74ee5c8b'/>
<id>urn:sha1:21f7eca555ad14e7c7b2cb59a6c6252e74ee5c8b</id>
<content type='text'>
The kernel uses 32-bit signed value(time_t) for seconds elapsed
1970-01-01:00:00:00, thus it will overflow at 2038-01-19 03:14:08
on 32-bit systems. This is widely known as the y2038 problem.

As part of addressing "y2038 problem" for in-kernel uses, this patch
adds safe do_settimeofday64() using timespec64.

After this patch, do_settimeofday() is deprecated and all its call
sites will be fixed using do_settimeofday64(), after that it can be
removed.

Signed-off-by: pang.xunlei &lt;pang.xunlei@linaro.org&gt;
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
</content>
</entry>
<entry>
<title>time: Complete NTP adjustment threshold judging conditions</title>
<updated>2014-11-21T19:59:56Z</updated>
<author>
<name>pang.xunlei</name>
<email>pang.xunlei@linaro.org</email>
</author>
<published>2014-10-09T07:04:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=659bc17b80c692e0ccda757e207fc4666d9b3e71'/>
<id>urn:sha1:659bc17b80c692e0ccda757e207fc4666d9b3e71</id>
<content type='text'>
The clocksource mult-adjustment threshold is [mult-maxadj, mult+maxadj],
timekeeping_adjust() only deals with the upper threshold, but misses the
lower threshold.

This patch adds the lower threshold judging condition.

Signed-off-by: pang.xunlei &lt;pang.xunlei@linaro.org&gt;
[jstultz: Minor fix for &gt; 80 char line]
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
</content>
</entry>
<entry>
<title>time: Avoid possible NTP adjustment mult overflow.</title>
<updated>2014-11-21T19:59:56Z</updated>
<author>
<name>pang.xunlei</name>
<email>pang.xunlei@linaro.org</email>
</author>
<published>2014-10-08T07:03:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6067dc5a8c2b1b57e67eaf1125db1d63c1ed6361'/>
<id>urn:sha1:6067dc5a8c2b1b57e67eaf1125db1d63c1ed6361</id>
<content type='text'>
Ideally, __clocksource_updatefreq_scale, selects the largest shift
value possible for a clocksource. This results in the mult memember of
struct clocksource being particularly large, although not so large
that NTP would adjust the clock to cause it to overflow.

That said, nothing actually prohibits an overflow from occuring, its
just that it "shouldn't" occur.

So while very unlikely, and so far never observed, the value of
(cs-&gt;mult+cs-&gt;maxadj) may have a chance to reach very near 0xFFFFFFFF,
so there is a possibility it may overflow when doing NTP positive
adjustment

See the following detail: When NTP slewes the clock, kernel goes
through update_wall_time()-&gt;...-&gt;timekeeping_apply_adjustment():
	tk-&gt;tkr.mult += mult_adj;

Since there is no guard against it, its possible tk-&gt;tkr.mult may
overflow during this operation.

This patch avoids any possible mult overflow by judging the overflow
case before adding mult_adj to mult, also adds the WARNING message
when capturing such case.

Signed-off-by: pang.xunlei &lt;pang.xunlei@linaro.org&gt;
[jstultz: Reworded commit message]
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
</content>
</entry>
<entry>
<title>timekeeping: Provide y2038 safe accessor to the seconds portion of CLOCK_REALTIME</title>
<updated>2014-10-29T14:15:40Z</updated>
<author>
<name>Heena Sirwani</name>
<email>heenasirwani@gmail.com</email>
</author>
<published>2014-10-29T10:31:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=dbe7aa622db96b5cd601f59d09c4f00b98b76079'/>
<id>urn:sha1:dbe7aa622db96b5cd601f59d09c4f00b98b76079</id>
<content type='text'>
ktime_get_real_seconds() is the replacement function for get_seconds()
returning the seconds portion of CLOCK_REALTIME in a time64_t. For
64bit the function is equivivalent to get_seconds(), but for 32bit it
protects the readout with the timekeeper sequence count. This is
required because 32-bit machines cannot access 64-bit tk-&gt;xtime_sec
variable atomically.

[tglx: Massaged changelog and added docbook comment ]

Signed-off-by: Heena Sirwani &lt;heenasirwani@gmail.com&gt;
Reviewed-by: Arnd Bergman &lt;arnd@arndb.de&gt;
Cc: John Stultz &lt;john.stultz@linaro.org&gt;
Cc: opw-kernel@googlegroups.com
Link: http://lkml.kernel.org/r/7adcfaa8962b8ad58785d9a2456c3f77d93c0ffb.1414578445.git.heenasirwani@gmail.com
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
</feed>
