diff options
Diffstat (limited to 'include/linux/timer.h')
| -rw-r--r-- | include/linux/timer.h | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/include/linux/timer.h b/include/linux/timer.h index a2d1eb6cb3f0..38cf093ef62c 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h | |||
| @@ -10,13 +10,19 @@ | |||
| 10 | struct tvec_base; | 10 | struct tvec_base; |
| 11 | 11 | ||
| 12 | struct timer_list { | 12 | struct timer_list { |
| 13 | /* | ||
| 14 | * All fields that change during normal runtime grouped to the | ||
| 15 | * same cacheline | ||
| 16 | */ | ||
| 13 | struct list_head entry; | 17 | struct list_head entry; |
| 14 | unsigned long expires; | 18 | unsigned long expires; |
| 19 | struct tvec_base *base; | ||
| 15 | 20 | ||
| 16 | void (*function)(unsigned long); | 21 | void (*function)(unsigned long); |
| 17 | unsigned long data; | 22 | unsigned long data; |
| 18 | 23 | ||
| 19 | struct tvec_base *base; | 24 | int slack; |
| 25 | |||
| 20 | #ifdef CONFIG_TIMER_STATS | 26 | #ifdef CONFIG_TIMER_STATS |
| 21 | void *start_site; | 27 | void *start_site; |
| 22 | char start_comm[16]; | 28 | char start_comm[16]; |
| @@ -94,6 +100,13 @@ void init_timer_deferrable_key(struct timer_list *timer, | |||
| 94 | setup_timer_on_stack_key((timer), #timer, &__key, \ | 100 | setup_timer_on_stack_key((timer), #timer, &__key, \ |
| 95 | (fn), (data)); \ | 101 | (fn), (data)); \ |
| 96 | } while (0) | 102 | } while (0) |
| 103 | #define setup_deferrable_timer_on_stack(timer, fn, data) \ | ||
| 104 | do { \ | ||
| 105 | static struct lock_class_key __key; \ | ||
| 106 | setup_deferrable_timer_on_stack_key((timer), #timer, \ | ||
| 107 | &__key, (fn), \ | ||
| 108 | (data)); \ | ||
| 109 | } while (0) | ||
| 97 | #else | 110 | #else |
| 98 | #define init_timer(timer)\ | 111 | #define init_timer(timer)\ |
| 99 | init_timer_key((timer), NULL, NULL) | 112 | init_timer_key((timer), NULL, NULL) |
| @@ -105,6 +118,8 @@ void init_timer_deferrable_key(struct timer_list *timer, | |||
| 105 | setup_timer_key((timer), NULL, NULL, (fn), (data)) | 118 | setup_timer_key((timer), NULL, NULL, (fn), (data)) |
| 106 | #define setup_timer_on_stack(timer, fn, data)\ | 119 | #define setup_timer_on_stack(timer, fn, data)\ |
| 107 | setup_timer_on_stack_key((timer), NULL, NULL, (fn), (data)) | 120 | setup_timer_on_stack_key((timer), NULL, NULL, (fn), (data)) |
| 121 | #define setup_deferrable_timer_on_stack(timer, fn, data)\ | ||
| 122 | setup_deferrable_timer_on_stack_key((timer), NULL, NULL, (fn), (data)) | ||
| 108 | #endif | 123 | #endif |
| 109 | 124 | ||
| 110 | #ifdef CONFIG_DEBUG_OBJECTS_TIMERS | 125 | #ifdef CONFIG_DEBUG_OBJECTS_TIMERS |
| @@ -144,6 +159,12 @@ static inline void setup_timer_on_stack_key(struct timer_list *timer, | |||
| 144 | init_timer_on_stack_key(timer, name, key); | 159 | init_timer_on_stack_key(timer, name, key); |
| 145 | } | 160 | } |
| 146 | 161 | ||
| 162 | extern void setup_deferrable_timer_on_stack_key(struct timer_list *timer, | ||
| 163 | const char *name, | ||
| 164 | struct lock_class_key *key, | ||
| 165 | void (*function)(unsigned long), | ||
| 166 | unsigned long data); | ||
| 167 | |||
| 147 | /** | 168 | /** |
| 148 | * timer_pending - is a timer pending? | 169 | * timer_pending - is a timer pending? |
| 149 | * @timer: the timer in question | 170 | * @timer: the timer in question |
| @@ -165,6 +186,8 @@ extern int mod_timer(struct timer_list *timer, unsigned long expires); | |||
| 165 | extern int mod_timer_pending(struct timer_list *timer, unsigned long expires); | 186 | extern int mod_timer_pending(struct timer_list *timer, unsigned long expires); |
| 166 | extern int mod_timer_pinned(struct timer_list *timer, unsigned long expires); | 187 | extern int mod_timer_pinned(struct timer_list *timer, unsigned long expires); |
| 167 | 188 | ||
| 189 | extern void set_timer_slack(struct timer_list *time, int slack_hz); | ||
| 190 | |||
| 168 | #define TIMER_NOT_PINNED 0 | 191 | #define TIMER_NOT_PINNED 0 |
| 169 | #define TIMER_PINNED 1 | 192 | #define TIMER_PINNED 1 |
| 170 | /* | 193 | /* |
