Timekeeping in the Linux Kernel
Talkat Embedded Linux Conference + OpenIoT Summit North America 2017 · on Wednesday, 2017-02-22· at 14:00· Grand Ballroom I/II·
summary
Linux kernel timekeeping maps hardware counters into nanoseconds using a computed clocksource multiplier and shift (clocks_calc_mult) to avoid slow divisions, tracks multiple timelines (MONOTONIC, BOOTTIME, RTC) as offsets from one accumulator across about six to seven files, and applies tiny NTP-like frequency tweaks to correct drift (example: an 8 Hz error yields ~2 ns slip after 100,000 cycles). Tick delivery uses per-CPU one-shot vs periodic clockevents and a global tick-broadcast for dead clockevents (needed on many ARM systems); code is upstream and broadly used.
AI-written summary · about
chapters (24)
- 0:00Intro
- 1:11there was a counter
- 6:43POSIX Clocks Comparison
- 7:37RAT in Action (Read)
- 8:05RAT in Action (Accumulate - Track)
- 8:53Juggling Clocks
- 9:57Handling Clock Drift
- 10:37Mult to the Rescue!
- 11:21Making Things Fast and Efficient
- 13:10Where We Are
- 13:40What if my system doesn't have a counter?
- 14:06Let's talk about jiffies
- 15:09Implementing the tick in hardware
- 15:35Abstract the Hardware!
- 17:09Three event_handlers
- 17:37Ticks During Ide
- 19:23High Resolution Mode
- 20:10Tick Devices
- 21:17Running the Tick
- 22:44Running the Tich Per-CPU
- 23:04Stopping the Tick
- 24:28Tick Broadcast
- 27:29HRTimers
- 28:14Summary
related talks
43mDo the Time Warp – the Rocky Horror PTP Show: Verification of Network Time...
47mReal-Time Linux: What Is Next?
50mA Portable Clock Cycle Based Performance Measurement System
26mTuning Real-Time Linux for ARM SoCs
53mPREEMPT_RT - How Not to Break It.
26mReal-time Linux: what is next?
48mUnified Boot Time Measurement: A Precise, Scalable Framework for Multi-Processor Systems
52mNot Really, but Kind of Real Time Linux
