Skip to contentSkip to conversation

timer: initialize the field slack of timer_list

PATCH In review Changli Gao 2 participants 2 messages Aug 17, 2010 – Aug 19, 2010 High-resolution timers, timer wheel, clockevents

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 timer: initialize the field slack of timer_list

TIMER_INITIALIZER() should initialize the field slack of timer_list as __init_timer() does.

---
 include/linux/timer.h |    1 +
 1 file changed, 1 insertion(+)
include/linux/timer.h +1 -0
index 38cf093..81de484 100644
@@ -54,6 +54,7 @@ extern struct tvec_base boot_tvec_bases;
 		.expires = (_expires),				\
 		.data = (_data),				\
 		.base = &boot_tvec_bases,			\
+		.slack = -1,					\
 		__TIMER_LOCKDEP_MAP_INITIALIZER(		\
 			__FILE__ ":" __stringify(__LINE__))	\
 	}
#1 lore raw
Quoted 3 lines · On Tue, 17 Aug 2010 14:37:44 +0800 Changli Gao <[email protected]> wrote:

TIMER_INITIALIZER() should initialize the field slack of timer_list as __init_timer() does.

So it should.

Quoted 8 lines
---
 include/linux/timer.h |    1 +
 1 file changed, 1 insertion(+)
include/linux/timer.h +0 -0
index 38cf093..81de484 100644

include/linux/timer.h extern struct tvec_base boot_tvec_bases; · line 60

Quoted 7 lines
include/linux/timer.h +1 -0
@@ -54,6 +54,7 @@ extern struct tvec_base boot_tvec_bases;
 		.expires = (_expires),				\
 		.data = (_data),				\
 		.base = &boot_tvec_bases,			\
+		.slack = -1,					\
 		__TIMER_LOCKDEP_MAP_INITIALIZER(		\
 			__FILE__ ":" __stringify(__LINE__))	\
 	}

I wonder what the runtime effects of this change are. Methinks we were wasting a few cycles in apply_slack()?