Timers and more timers!

After completing the migration of unpinned timers to non-nohz_full CPUs, this week I moved on to pinned timers. The idea, as I’ve mentioned before is to reduce OS jitter or internal work on CPU’s which need to concentrate on single HPC tasks.

Time you enjoy wasting is not wasted time.’, J.R.R. Tolkien

When a CPU is idle or in other words, is in a deep idle state because of which it would conserve more power, we don’t want to disturb it if we can afford to.

This would be in terms of timers, tasks (userspace and kernel space) that we’d like to defer or shift to a non-idle CPU.

Deferrable timers are those that can be ignored sometimes. They are not “cancelled”, they are “ignored”. We know that the periodic tick fires at its frequency does statistical work like figuring out the load on the CPUs and schedules and preempts tasks accordingly. When the system is idle, the frequency of these ticks is reduced. While programming the clock to fire, deferrable timers are ignored and the clock is scheduled to fire at the next non-deferrable timers expiry time. If the timers queued are all deferrable, the ticks can be stopped altogether as the CPU is idle.

An example of this would be the intel_pstate timer. Intel P states driver manages CPU
frequency via the handling the P-States (Power states) that CPUs go into. If the CPU is idle, there is no load to evaluate on it and the intel_pstate timer can be safely ignored.

So now we will move on to see whether we can delay or move pinned timers so as to not disturb nohz_full CPUs.


One thought on “Timers and more timers!

  1. Hi!

    If I understand, the idea of dynticks is to reduce the amount of ticks the system does to interrupt the tasks (or the idle state), so the kernel reduce the tick frequency or delay the tick. How it decides the amount of time to delay the tick?

    When do you say that deferrable timers are “ignored”, it means that its interruption is masked by hardware? That there is an interruption for each X ticks of the specific timer T (thus causing a clock in X ticks of the timer T), so we consider that the time X, 2X, 3X, 4X … are non-deferrable ticks?

    Thank you


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s