64-bit sched_clock
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest13 patches 0 repliesNew
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/13 | ARM: sched_clock: provide common infrastructure for sched_clock()arch/ arch/ arch/ +1 more | +189 | 0 replies | |
| 1/13 | ARM: sched_clock: provide common infrastructure for sched_clock()arch/ arch/ arch/ +1 more | +188 | 0 replies | |
| 2/13 | ARM: ixp4xx: convert sched_clock() to use new infrastructurearch/ arch/ | +21 | 0 replies | |
| 3/13 | ARM: mmp: convert sched_clock() to use new infrastructurearch/ arch/ | +12 | 0 replies | |
| 4/13 | ARM: pxa: convert sched_clock() to use new infrastructurearch/ arch/ | +10 | 1 reply | |
| 4/13 | ARM: pxa: convert sched_clock() to use new infrastructure | +0 | 0 replies | |
| 5/13 | ARM: sa1100: convert sched_clock() to use new infrastructurearch/ arch/ arch/ | +31 | 0 replies | |
| 6/13 | ARM: tegra: convert sched_clock() to use new infrastructurearch/ arch/ | +21 | 0 replies | |
| 7/13 | ARM: u300: convert sched_clock() to use new infrastructurearch/ arch/ | +14 | 0 replies | |
| 8/13 | ARM: iop: convert sched_clock() to use new infrastructurearch/ arch/ | +12 | 0 replies | |
| 9/13 | ARM: nomadik: convert sched_clock() to use new infrastructurearch/ arch/ | +10 | 0 replies | |
| 10/13 | ARM: omap: convert sched_clock() to use new infrastructurearch/ arch/ | +23 | 0 replies | |
| 11/13 | ARM: orion: convert sched_clock() to use new infrastructurearch/ arch/ | +10 | 0 replies | |
| 12/13 | ARM: versatile: convert sched_clock() to use new infrastructurearch/ arch/ arch/ +2 more | +54 | 0 replies | |
| 13/13 | ARM: vexpress: add sched_clock() for Versatile Expressarch/ arch/ arch/ | +6 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/13] 64-bit sched_clock
This patch series replaces existing sched_clock() implementations with a version which gives a full 64-bit nanosecond time from counters with less than 33 bits.
This series depends on the prevously posted clocksource patch series, and the notrace sched_clock patch, and the ftrace tree previously merged into my devel-stable branch. It also depends on a fix to the clocksource code to achieve the accuracy quoted below - though it'll build and work without.
We achieve the 64-bit nanosecond time by maintaining a pair of epochs - one for the counter and a corresponding one for the ns value. This allows us to calculate how many counter ticks have happened since the ns epoch was last updated, and therefore how much time has passed.
We use a lockless method to read and update the epoch values, eliminating any locking overhead. The epoch update happens at about 90% of the wrap period, resulting in less maintainence overhead.
Lastly, we allow platforms to provide constants for the counter->ns conversion.
The PXA sched_clock implementation using cnt32_to_63() builds to 72 bytes of code and 12 bytes of data, and provides 54 bits of nanoseconds, with an error of 0.00008%.
The PXA sched_clock implementation using this infrastructure builds to 84 bytes of code and 8 bytes of data, and provides 64 bits of nanoseconds, with an error of 0.00000002%.
The epoch updates in action on Versatile Express (24MHz 32-bit counter):
sched_clock: update 68391420 -> 50e0a246 0ns -> 162637292211nssched_clock: update 50e0a246 -> 372c24b7 162637292211ns -> 323625136880nssched_clock: update 372c24b7 -> 1d35c46a 323625136880ns -> 484433069633nssched_clock: update 1d35c46a -> 0367a736 484433069633ns -> 645350944761ns
...sched_clock: update f6f7fd55 -> dd2d882e 32669955162290ns -> 32830883021959nssched_clock: update dd2d882e -> c36312cd 32830883021959ns -> 32991810879212nssched_clock: update c36312cd -> a9989d41 32991810879212ns -> 33152738734673nssched_clock: update a9989d41 -> 8fce2781 33152738734673ns -> 33313666587967ns