Who's counting jiffies when all CPUs idle in NO_HZ mode?

Who's counting jiffies when all CPUs idle in NO_HZ mode?

Elazar Leibovich elazarl at gmail.com
Tue Mar 25 23:04:02 IST 2014


(I'm talking now about MONOTONIC_CLOCK_RAW, not taking NTP adjustment into
account)

To my understanding, the basic time counting mechanism at the Linux kernel,
is the jiffies counter. The way it counts time, is by leveraging a CPU
interrupt happening at a certain known frequency. Every time this interrupt
occurs, the interrupt handler would increment a counter. By multiplying
this counter with the IRQ's frequency, we can estimate how much time passed.

Now, to my understanding, the NO_HZ_IDLE=y configuration, would prevent any
interrupt on idle CPUs.

The CONFIG_NO_HZ_IDLE=y Kconfig option causes the kernel to avoid sending
> scheduling-clock interrupts to idle CPUs

https://www.kernel.org/doc/Documentation/timers/NO_HZ.txt

So to my understanding, if all CPUs are idle, nothing is going to run on
any CPU.

Who would count jiffies then? How can we be sure how much time passed with
no hardware clock (as it is the case in some systems), and all CPUs asleep?

לינוקס נוסעת מפרשיה שניים,
ומעבדיה נרדמו כולם.
אם לא יעורו כל מעבדיה,
איכה תמנה, כמה עברו שניות?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.cs.huji.ac.il/pipermail/linux-il/attachments/20140325/e882cdb2/attachment.html>


More information about the Linux-il mailing list