]> git.baikalelectronics.ru Git - kernel.git/commit
timers: Introduce the concept of timer slack for legacy timers
authorArjan van de Ven <arjan@linux.intel.com>
Thu, 11 Mar 2010 22:04:36 +0000 (14:04 -0800)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 6 Apr 2010 19:50:02 +0000 (21:50 +0200)
commit1df40c78e8853ba273e5c23b3dba37e2488ee17b
treeb560e8c15102281a110cd5ccd93866084e31014b
parent1d1a7b38f664e2704bac439fc3e34927dbd694ca
timers: Introduce the concept of timer slack for legacy timers

While HR timers have had the concept of timer slack for quite some time
now, the legacy timers lacked this concept, and had to make do with
round_jiffies() and friends.

Timer slack is important for power management; grouping timers reduces the
number of wakeups which in turn reduces power consumption.

This patch introduces timer slack to the legacy timers using the following
pieces:
* A slack field in the timer struct
* An api (set_timer_slack) that callers can use to set explicit timer slack
* A default slack of 0.4% of the requested delay for callers that do not set
  any explicit slack
* Rounding code that is part of mod_timer() that tries to
  group timers around jiffies values every 'power of two'
  (so quick timers will group around every 2, but longer timers
  will group around every 4, 8, 16, 32 etc)

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Cc: johnstul@us.ibm.com
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
include/linux/timer.h
kernel/timer.c