diff options
| author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2015-09-03 13:01:44 -0400 |
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2015-09-03 13:01:44 -0400 |
| commit | 01b944fe1cd4e21a2a9ed51adbdbafe2d5e905ba (patch) | |
| tree | 85f506cf9fce3d8fd47cf624dd8698472bffc13f /include/linux/timer.h | |
| parent | e51e38494a8ecc18650efb0c840600637891de2c (diff) | |
| parent | 58f1eae48e5372200553de07b5ecc7574803ee91 (diff) | |
Merge branch 'next' into for-linus
Prepare first round of input updates for 4.3 merge window.
Diffstat (limited to 'include/linux/timer.h')
| -rw-r--r-- | include/linux/timer.h | 63 |
1 files changed, 28 insertions, 35 deletions
diff --git a/include/linux/timer.h b/include/linux/timer.h index 8c5a197e1587..61aa61dc410c 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h | |||
| @@ -14,27 +14,23 @@ struct timer_list { | |||
| 14 | * All fields that change during normal runtime grouped to the | 14 | * All fields that change during normal runtime grouped to the |
| 15 | * same cacheline | 15 | * same cacheline |
| 16 | */ | 16 | */ |
| 17 | struct list_head entry; | 17 | struct hlist_node entry; |
| 18 | unsigned long expires; | 18 | unsigned long expires; |
| 19 | struct tvec_base *base; | 19 | void (*function)(unsigned long); |
| 20 | 20 | unsigned long data; | |
| 21 | void (*function)(unsigned long); | 21 | u32 flags; |
| 22 | unsigned long data; | 22 | int slack; |
| 23 | |||
| 24 | int slack; | ||
| 25 | 23 | ||
| 26 | #ifdef CONFIG_TIMER_STATS | 24 | #ifdef CONFIG_TIMER_STATS |
| 27 | int start_pid; | 25 | int start_pid; |
| 28 | void *start_site; | 26 | void *start_site; |
| 29 | char start_comm[16]; | 27 | char start_comm[16]; |
| 30 | #endif | 28 | #endif |
| 31 | #ifdef CONFIG_LOCKDEP | 29 | #ifdef CONFIG_LOCKDEP |
| 32 | struct lockdep_map lockdep_map; | 30 | struct lockdep_map lockdep_map; |
| 33 | #endif | 31 | #endif |
| 34 | }; | 32 | }; |
| 35 | 33 | ||
| 36 | extern struct tvec_base boot_tvec_bases; | ||
| 37 | |||
| 38 | #ifdef CONFIG_LOCKDEP | 34 | #ifdef CONFIG_LOCKDEP |
| 39 | /* | 35 | /* |
| 40 | * NB: because we have to copy the lockdep_map, setting the lockdep_map key | 36 | * NB: because we have to copy the lockdep_map, setting the lockdep_map key |
| @@ -49,9 +45,6 @@ extern struct tvec_base boot_tvec_bases; | |||
| 49 | #endif | 45 | #endif |
| 50 | 46 | ||
| 51 | /* | 47 | /* |
| 52 | * Note that all tvec_bases are at least 4 byte aligned and lower two bits | ||
| 53 | * of base in timer_list is guaranteed to be zero. Use them for flags. | ||
| 54 | * | ||
| 55 | * A deferrable timer will work normally when the system is busy, but | 48 | * A deferrable timer will work normally when the system is busy, but |
| 56 | * will not cause a CPU to come out of idle just to service it; instead, | 49 | * will not cause a CPU to come out of idle just to service it; instead, |
| 57 | * the timer will be serviced when the CPU eventually wakes up with a | 50 | * the timer will be serviced when the CPU eventually wakes up with a |
| @@ -65,17 +58,18 @@ extern struct tvec_base boot_tvec_bases; | |||
| 65 | * workqueue locking issues. It's not meant for executing random crap | 58 | * workqueue locking issues. It's not meant for executing random crap |
| 66 | * with interrupts disabled. Abuse is monitored! | 59 | * with interrupts disabled. Abuse is monitored! |
| 67 | */ | 60 | */ |
| 68 | #define TIMER_DEFERRABLE 0x1LU | 61 | #define TIMER_CPUMASK 0x0007FFFF |
| 69 | #define TIMER_IRQSAFE 0x2LU | 62 | #define TIMER_MIGRATING 0x00080000 |
| 70 | 63 | #define TIMER_BASEMASK (TIMER_CPUMASK | TIMER_MIGRATING) | |
| 71 | #define TIMER_FLAG_MASK 0x3LU | 64 | #define TIMER_DEFERRABLE 0x00100000 |
| 65 | #define TIMER_IRQSAFE 0x00200000 | ||
| 72 | 66 | ||
| 73 | #define __TIMER_INITIALIZER(_function, _expires, _data, _flags) { \ | 67 | #define __TIMER_INITIALIZER(_function, _expires, _data, _flags) { \ |
| 74 | .entry = { .prev = TIMER_ENTRY_STATIC }, \ | 68 | .entry = { .next = TIMER_ENTRY_STATIC }, \ |
| 75 | .function = (_function), \ | 69 | .function = (_function), \ |
| 76 | .expires = (_expires), \ | 70 | .expires = (_expires), \ |
| 77 | .data = (_data), \ | 71 | .data = (_data), \ |
| 78 | .base = (void *)((unsigned long)&boot_tvec_bases + (_flags)), \ | 72 | .flags = (_flags), \ |
| 79 | .slack = -1, \ | 73 | .slack = -1, \ |
| 80 | __TIMER_LOCKDEP_MAP_INITIALIZER( \ | 74 | __TIMER_LOCKDEP_MAP_INITIALIZER( \ |
| 81 | __FILE__ ":" __stringify(__LINE__)) \ | 75 | __FILE__ ":" __stringify(__LINE__)) \ |
| @@ -168,7 +162,7 @@ static inline void init_timer_on_stack_key(struct timer_list *timer, | |||
| 168 | */ | 162 | */ |
| 169 | static inline int timer_pending(const struct timer_list * timer) | 163 | static inline int timer_pending(const struct timer_list * timer) |
| 170 | { | 164 | { |
| 171 | return timer->entry.next != NULL; | 165 | return timer->entry.pprev != NULL; |
| 172 | } | 166 | } |
| 173 | 167 | ||
| 174 | extern void add_timer_on(struct timer_list *timer, int cpu); | 168 | extern void add_timer_on(struct timer_list *timer, int cpu); |
| @@ -188,26 +182,16 @@ extern void set_timer_slack(struct timer_list *time, int slack_hz); | |||
| 188 | #define NEXT_TIMER_MAX_DELTA ((1UL << 30) - 1) | 182 | #define NEXT_TIMER_MAX_DELTA ((1UL << 30) - 1) |
| 189 | 183 | ||
| 190 | /* | 184 | /* |
| 191 | * Return when the next timer-wheel timeout occurs (in absolute jiffies), | ||
| 192 | * locks the timer base and does the comparison against the given | ||
| 193 | * jiffie. | ||
| 194 | */ | ||
| 195 | extern unsigned long get_next_timer_interrupt(unsigned long now); | ||
| 196 | |||
| 197 | /* | ||
| 198 | * Timer-statistics info: | 185 | * Timer-statistics info: |
| 199 | */ | 186 | */ |
| 200 | #ifdef CONFIG_TIMER_STATS | 187 | #ifdef CONFIG_TIMER_STATS |
| 201 | 188 | ||
| 202 | extern int timer_stats_active; | 189 | extern int timer_stats_active; |
| 203 | 190 | ||
| 204 | #define TIMER_STATS_FLAG_DEFERRABLE 0x1 | ||
| 205 | |||
| 206 | extern void init_timer_stats(void); | 191 | extern void init_timer_stats(void); |
| 207 | 192 | ||
| 208 | extern void timer_stats_update_stats(void *timer, pid_t pid, void *startf, | 193 | extern void timer_stats_update_stats(void *timer, pid_t pid, void *startf, |
| 209 | void *timerf, char *comm, | 194 | void *timerf, char *comm, u32 flags); |
| 210 | unsigned int timer_flag); | ||
| 211 | 195 | ||
| 212 | extern void __timer_stats_timer_set_start_info(struct timer_list *timer, | 196 | extern void __timer_stats_timer_set_start_info(struct timer_list *timer, |
| 213 | void *addr); | 197 | void *addr); |
| @@ -254,6 +238,15 @@ extern void run_local_timers(void); | |||
| 254 | struct hrtimer; | 238 | struct hrtimer; |
| 255 | extern enum hrtimer_restart it_real_fn(struct hrtimer *); | 239 | extern enum hrtimer_restart it_real_fn(struct hrtimer *); |
| 256 | 240 | ||
| 241 | #if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ_COMMON) | ||
| 242 | #include <linux/sysctl.h> | ||
| 243 | |||
| 244 | extern unsigned int sysctl_timer_migration; | ||
| 245 | int timer_migration_handler(struct ctl_table *table, int write, | ||
| 246 | void __user *buffer, size_t *lenp, | ||
| 247 | loff_t *ppos); | ||
| 248 | #endif | ||
| 249 | |||
| 257 | unsigned long __round_jiffies(unsigned long j, int cpu); | 250 | unsigned long __round_jiffies(unsigned long j, int cpu); |
| 258 | unsigned long __round_jiffies_relative(unsigned long j, int cpu); | 251 | unsigned long __round_jiffies_relative(unsigned long j, int cpu); |
| 259 | unsigned long round_jiffies(unsigned long j); | 252 | unsigned long round_jiffies(unsigned long j); |
