Home

kernelklok

Kernelklok is a term used in computing to refer to the kernel’s internal timekeeping system. It describes the part of an operating system kernel that tracks time, provides timestamps, and drives timers and scheduling decisions. The kernelklok maintains both the wall clock (system time) and a monotonic clock that never regresses, the latter being important for reliable time intervals and correct sequencing of events.

The kernelklok operates by combining a hardware time source with software timers. A hardware clock, such as

Different kernels implement the kernelklok with varying mechanisms. Linux uses a timekeeping framework built around clocksources,

See also: timekeeping, clocksource, hrtimer, monotonic clock, system time, time synchronization.

a
real-time
clock
or
a
high-resolution
timer,
provides
a
base
signal,
which
the
kernel
translates
into
a
steadily
advancing
time
value.
To
support
precise
timing
and
efficient
scheduling,
most
kernels
implement
a
timekeeping
subsystem
that
can
switch
between
low-power
tick-based
modes
and
tickless
operation.
The
subsystem
exposes
various
clocks
to
user
space,
such
as
real
time
and
monotonic
time,
and
it
handles
time
adjustments
prompted
by
external
references
like
NTP.
When
time
is
adjusted,
the
kernel
may
step
or
slew
the
clock
while
attempting
to
preserve
monotonicity
for
ongoing
operations.
clockevents,
and
high-resolution
timers
(hrtimers).
Windows
maintains
its
own
kernel
timekeeping
using
performance
counters
and
related
facilities.
BSD
systems
rely
on
timecounter
mechanisms
and
related
components.
Across
platforms,
the
kernelklok
must
balance
precision,
efficiency,
and
correctness,
particularly
in
virtualized
environments,
during
suspend/resume
cycles,
and
when
handling
leap
seconds
and
timezone
representations.