<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/time/timekeeping.c, branch v2.6.25</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=v2.6.25</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v2.6.25'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2008-03-24T18:07:15Z</updated>
<entry>
<title>Don't 'printk()' while holding xtime lock for writing</title>
<updated>2008-03-24T18:07:15Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2008-03-24T18:07:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=92896bd9fd75b1c993b92874d339a8088bb75560'/>
<id>urn:sha1:92896bd9fd75b1c993b92874d339a8088bb75560</id>
<content type='text'>
The printk() can deadlock because it can wake up klogd(), and
task enqueueing will try to read the time in order to set a hrtimer.

Reported-by: Marcin Slusarz &lt;marcin.slusarz@gmail.com&gt;
Debugged-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>time: remove obsolete CLOCK_TICK_ADJUST</title>
<updated>2008-03-09T07:42:57Z</updated>
<author>
<name>Roman Zippel</name>
<email>zippel@linux-m68k.org</email>
</author>
<published>2008-03-04T23:14:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=10a398d04c4a1fc395840f4d040493375f562302'/>
<id>urn:sha1:10a398d04c4a1fc395840f4d040493375f562302</id>
<content type='text'>
The first version of the ntp_interval/tick_length inconsistent usage patch was
recently merged as bbe4d18ac2e058c56adb0cd71f49d9ed3216a405

http://git.kernel.org/gitweb.cgi?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bbe4d18ac2e058c56adb0cd71f49d9ed3216a405

While the fix did greatly improve the situation, it was correctly pointed out
by Roman that it does have a small bug: If the users change clocksources after
the system has been running and NTP has made corrections, the correctoins made
against the old clocksource will be applied against the new clocksource,
causing error.

The second attempt, which corrects the issue in the NTP_INTERVAL_LENGTH
definition has also made it up-stream as commit
e13a2e61dd5152f5499d2003470acf9c838eab84

http://git.kernel.org/gitweb.cgi?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e13a2e61dd5152f5499d2003470acf9c838eab84

Roman has correctly pointed out that CLOCK_TICK_ADJUST is calculated
based on the PIT's frequency, and isn't really relevant to non-PIT
driven clocksources (that is, clocksources other then jiffies and pit).

This patch reverts both of those changes, and simply removes
CLOCK_TICK_ADJUST.

This does remove the granularity error correction for users of PIT and Jiffies
clocksource users, but the granularity error but for the majority of users, it
should be within the 500ppm range NTP can accommodate for.

For systems that have granularity errors greater then 500ppm, the
"ntp_tick_adj=" boot option can be used to compensate.

[johnstul@us.ibm.com: provided changelog]
[mattilinnanvuori@yahoo.com: maek ntp_tick_adj static]
Signed-off-by: Roman Zippel &lt;zippel@linux-m68k.org&gt;
Acked-by: john stultz &lt;johnstul@us.ibm.com&gt;
Signed-off-by: Matti Linnanvuori &lt;mattilinnanvuori@yahoo.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: mingo@elte.hu
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>time: fix typo in comments</title>
<updated>2008-02-08T17:22:29Z</updated>
<author>
<name>Li Zefan</name>
<email>lizf@cn.fujitsu.com</email>
</author>
<published>2008-02-08T12:19:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3eb056764dd806bbe84eb604e45e7470feeaafd8'/>
<id>urn:sha1:3eb056764dd806bbe84eb604e45e7470feeaafd8</id>
<content type='text'>
Fix typo in comments.

BTW: I have to fix coding style in arch/ia64/kernel/time.c also, otherwise
checkpatch.pl will be complaining.

Signed-off-by: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: john stultz &lt;johnstul@us.ibm.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>timekeeping: rename timekeeping_is_continuous to timekeeping_valid_for_hres</title>
<updated>2008-02-08T17:22:29Z</updated>
<author>
<name>Li Zefan</name>
<email>lizf@cn.fujitsu.com</email>
</author>
<published>2008-02-08T12:19:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=cf4fc6cb76e50b01666e28a9f4b2e6fbcbb96d5f'/>
<id>urn:sha1:cf4fc6cb76e50b01666e28a9f4b2e6fbcbb96d5f</id>
<content type='text'>
Function timekeeping_is_continuous() no longer checks flag
CLOCK_IS_CONTINUOUS, and it checks CLOCK_SOURCE_VALID_FOR_HRES now.  So rename
the function accordingly.

Signed-off-by: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: john stultz &lt;johnstul@us.ibm.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>timekeeping: update xtime_cache when time(zone) changes</title>
<updated>2008-02-01T16:45:13Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2008-02-01T16:45:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1001d0a9ee74a468077dfd4da0565174e88de26b'/>
<id>urn:sha1:1001d0a9ee74a468077dfd4da0565174e88de26b</id>
<content type='text'>
xtime_cache needs to be updated whenever xtime and or wall_to_monotic
are changed. Otherwise users of xtime_cache might see a stale (and in
the case of timezone changes utterly wrong) value until the next
update happens.

Fixup the obvious places, which miss this update.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Acked-by: John Stultz &lt;johnstul@us.ibm.com&gt;
Tested-by: Dhaval Giani &lt;dhaval@linux.vnet.ibm.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>NTP: correct inconsistent ntp interval/tick_length usage</title>
<updated>2008-01-30T12:30:03Z</updated>
<author>
<name>john stultz</name>
<email>johnstul@us.ibm.com</email>
</author>
<published>2008-01-30T12:30:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=bbe4d18ac2e058c56adb0cd71f49d9ed3216a405'/>
<id>urn:sha1:bbe4d18ac2e058c56adb0cd71f49d9ed3216a405</id>
<content type='text'>
I recently noticed on one of my boxes that when synched with an NTP
server, the drift value reported for the system was ~283ppm. While in
some cases, clock hardware can be that bad, it struck me as unusual as
the system was using the acpi_pm clocksource, which is one of the more
trustworthy and accurate clocksources on x86 hardware.

I brought up another system and let it sync to the same NTP server, and
I noticed a similar 280some ppm drift.

In looking at the code, I found that the acpi_pm's constant frequency
was being computed correctly at boot-up, however once the system was up,
even without the ntp daemon running, the clocksource's frequency was
being modified by the clocksource_adjust() function.

Digging deeper, I realized that in the code that keeps track of how much
the clocksource is skewing from the ntp desired time, we were using
different lengths to establish how long an time interval was.

The clocksource was being setup with the following interval:
	NTP_INTERVAL_LENGTH = NSEC_PER_SEC/NTP_INTERVAL_FREQ

While the ntp code was using the tick_length_base value:
	tick_length_base ~= (tick_usec * NSEC_PER_USEC * USER_HZ)
					/NTP_INTERVAL_FREQ

The subtle difference is:
	(tick_usec * NSEC_PER_USEC * USER_HZ) != NSEC_PER_SEC

This difference in calculation was causing the clocksource correction
code to apply a correction factor to the clocksource so the two
intervals were the same, however this results in the actual frequency of
the clocksource to be made incorrect. I believe this difference would
affect all clocksources, although to differing degrees depending on the
clocksource resolution.

The issue was introduced when my HZ free ntp patch landed in 2.6.21-rc1,
so my apologies for the mistake, and for not noticing it until now.

The following patch, corrects the clocksource's initialization code so
it uses the same interval length as the code in ntp.c. After applying
this patch, the drift value for the same system went from ~283ppm to
only 2.635ppm.

I believe this patch to be good, however it does affect all arches and
I've only tested on x86, so some caution is advised. I do think it would
be a likely candidate for a stable 2.6.24.x release.

Any thoughts or feedback would be appreciated.

Signed-off-by: John Stultz &lt;johnstul@us.ibm.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>time: fold __get_realtime_clock_ts() into getnstimeofday()</title>
<updated>2008-01-30T12:30:01Z</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>Geert.Uytterhoeven@sonycom.com</email>
</author>
<published>2008-01-30T12:30:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=efd9ac8630e89b9ee7ce64008bd7783952374f37'/>
<id>urn:sha1:efd9ac8630e89b9ee7ce64008bd7783952374f37</id>
<content type='text'>
  - getnstimeofday() was just a wrapper around __get_realtime_clock_ts()
  - Replace calls to __get_realtime_clock_ts() by calls to getnstimeofday()
  - Fix bogus reference to get_realtime_clock_ts(), which never existed

Signed-off-by: Geert Uytterhoeven &lt;Geert.Uytterhoeven@sonycom.com&gt;
Cc: john stultz &lt;johnstul@us.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>Driver core: change sysdev classes to use dynamic kobject names</title>
<updated>2008-01-25T04:40:40Z</updated>
<author>
<name>Kay Sievers</name>
<email>kay.sievers@vrfy.org</email>
</author>
<published>2007-12-20T01:09:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=af5ca3f4ec5cc4432a42a73b050dd8898ce8fd00'/>
<id>urn:sha1:af5ca3f4ec5cc4432a42a73b050dd8898ce8fd00</id>
<content type='text'>
All kobjects require a dynamically allocated name now. We no longer
need to keep track if the name is statically assigned, we can just
unconditionally free() all kobject names on cleanup.

Signed-off-by: Kay Sievers &lt;kay.sievers@vrfy.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>kernel/time/timekeeping.c: cleanups</title>
<updated>2007-10-17T15:42:53Z</updated>
<author>
<name>Adrian Bunk</name>
<email>bunk@kernel.org</email>
</author>
<published>2007-10-17T06:27:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ba2a631b14fe8a9c122801c648c49a543d020d8d'/>
<id>urn:sha1:ba2a631b14fe8a9c122801c648c49a543d020d8d</id>
<content type='text'>
- remove the no longer required __attribute__((weak)) of xtime_lock
- remove the following no longer used EXPORT_SYMBOL's:
  - xtime
  - xtime_lock

Signed-off-by: Adrian Bunk &lt;bunk@kernel.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: john stultz &lt;johnstul@us.ibm.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>time: introduce xtime_seconds</title>
<updated>2007-10-16T17:01:50Z</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@elte.hu</email>
</author>
<published>2007-10-16T14:09:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f20bf6125605acbbc7eb8c9420d7221c91aa83eb'/>
<id>urn:sha1:f20bf6125605acbbc7eb8c9420d7221c91aa83eb</id>
<content type='text'>
improve performance of sys_time(). sys_time() returns time in seconds,
but it does so by calling do_gettimeofday() and then returning the
tv_sec portion of the GTOD time. But the data structure "xtime", which
is updated by every timer/scheduler tick, already offers HZ granularity
time.

the patch improves the sysbench oltp macrobenchmark by 4-5% on an AMD
dual-core system:

v2.6.23:

#threads

   1:     transactions:                        4073   (407.23 per sec.)
   2:     transactions:                        8530   (852.81 per sec.)
   3:     transactions:                        8321   (831.88 per sec.)
   4:     transactions:                        8407   (840.58 per sec.)
   5:     transactions:                        8070   (806.74 per sec.)

v2.6.23 + sys_time-speedup.patch:

   1:     transactions:                        4281   (428.09 per sec.)
   2:     transactions:                        8910   (890.85 per sec.)
   3:     transactions:                        8659   (865.79 per sec.)
   4:     transactions:                        8676   (867.34 per sec.)
   5:     transactions:                        8532   (852.91 per sec.)

and by 4-5% on an Intel dual-core system too:

2.6.23:

  1:     transactions:                        4560   (455.94 per sec.)
  2:     transactions:                        10094  (1009.30 per sec.)
  3:     transactions:                        9755   (975.36 per sec.)
  4:     transactions:                        9859   (985.78 per sec.)
  5:     transactions:                        9701   (969.72 per sec.)

2.6.23 + sys_time-speedup.patch:

  1:     transactions:                        4779   (477.84 per sec.)
  2:     transactions:                        10103  (1010.14 per sec.)
  3:     transactions:                        10141  (1013.93 per sec.)
  4:     transactions:                        10371  (1036.89 per sec.)
  5:     transactions:                        10178  (1017.50 per sec.)

(the more CPUs the system has, the more speedup this patch gives for
this particular workload.)

Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
