aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorFelipe Cerqueira <felipec@mpi-sws.org>2013-02-11 10:36:35 -0500
committerBjoern Brandenburg <bbb@mpi-sws.org>2014-06-07 05:30:32 -0400
commit14e6b5665983e393f6c073f635f2aaf947ff7448 (patch)
tree1abbd5409f3476c5abd45d015e851be5c03f08fc /include
parentdacc06b7f1cd1086ec08704eafea0e1009a69108 (diff)
Add hrtimer_start_on() support
This patch adds hrtimer_start_on(), which allows arming timers on remote CPUs. This is needed to avoided timer interrupts on "shielded" CPUs and is also useful for implementing semi-partitioned schedulers.
Diffstat (limited to 'include')
-rw-r--r--include/linux/hrtimer.h32
-rw-r--r--include/linux/smp.h5
2 files changed, 37 insertions, 0 deletions
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index d19a5c2d2270..93def50764dd 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -176,6 +176,7 @@ enum hrtimer_base_type {
176 * @nr_hangs: Total number of hrtimer interrupt hangs 176 * @nr_hangs: Total number of hrtimer interrupt hangs
177 * @max_hang_time: Maximum time spent in hrtimer_interrupt 177 * @max_hang_time: Maximum time spent in hrtimer_interrupt
178 * @clock_base: array of clock bases for this cpu 178 * @clock_base: array of clock bases for this cpu
179 * @to_pull: LITMUS^RT list of timers to be pulled on this cpu
179 */ 180 */
180struct hrtimer_cpu_base { 181struct hrtimer_cpu_base {
181 raw_spinlock_t lock; 182 raw_spinlock_t lock;
@@ -191,8 +192,32 @@ struct hrtimer_cpu_base {
191 ktime_t max_hang_time; 192 ktime_t max_hang_time;
192#endif 193#endif
193 struct hrtimer_clock_base clock_base[HRTIMER_MAX_CLOCK_BASES]; 194 struct hrtimer_clock_base clock_base[HRTIMER_MAX_CLOCK_BASES];
195 struct list_head to_pull;
194}; 196};
195 197
198#ifdef CONFIG_ARCH_HAS_SEND_PULL_TIMERS
199
200#define HRTIMER_START_ON_INACTIVE 0
201#define HRTIMER_START_ON_QUEUED 1
202
203/*
204 * struct hrtimer_start_on_info - save timer info on remote cpu
205 * @list: list of hrtimer_start_on_info on remote cpu (to_pull)
206 * @timer: timer to be triggered on remote cpu
207 * @time: time event
208 * @mode: timer mode
209 * @state: activity flag
210 */
211struct hrtimer_start_on_info {
212 struct list_head list;
213 struct hrtimer *timer;
214 ktime_t time;
215 enum hrtimer_mode mode;
216 atomic_t state;
217};
218
219#endif
220
196static inline void hrtimer_set_expires(struct hrtimer *timer, ktime_t time) 221static inline void hrtimer_set_expires(struct hrtimer *timer, ktime_t time)
197{ 222{
198 timer->node.expires = time; 223 timer->node.expires = time;
@@ -366,6 +391,13 @@ __hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim,
366 unsigned long delta_ns, 391 unsigned long delta_ns,
367 const enum hrtimer_mode mode, int wakeup); 392 const enum hrtimer_mode mode, int wakeup);
368 393
394#ifdef CONFIG_ARCH_HAS_SEND_PULL_TIMERS
395extern void hrtimer_start_on_info_init(struct hrtimer_start_on_info *info);
396extern int hrtimer_start_on(int cpu, struct hrtimer_start_on_info *info,
397 struct hrtimer *timer, ktime_t time,
398 const enum hrtimer_mode mode);
399#endif
400
369extern int hrtimer_cancel(struct hrtimer *timer); 401extern int hrtimer_cancel(struct hrtimer *timer);
370extern int hrtimer_try_to_cancel(struct hrtimer *timer); 402extern int hrtimer_try_to_cancel(struct hrtimer *timer);
371 403
diff --git a/include/linux/smp.h b/include/linux/smp.h
index c8488763277f..4f78ea77662c 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -84,6 +84,11 @@ int smp_call_function_any(const struct cpumask *mask,
84void kick_all_cpus_sync(void); 84void kick_all_cpus_sync(void);
85 85
86/* 86/*
87 * sends a 'pull timer' event to a remote CPU
88 */
89extern void smp_send_pull_timers(int cpu);
90
91/*
87 * Generic and arch helpers 92 * Generic and arch helpers
88 */ 93 */
89#ifdef CONFIG_USE_GENERIC_SMP_HELPERS 94#ifdef CONFIG_USE_GENERIC_SMP_HELPERS