diff options
author | Arun R Bharadwaj <arun@linux.vnet.ibm.com> | 2009-04-16 02:46:41 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2009-05-13 10:52:42 -0400 |
commit | eea08f32adb3f97553d49a4f79a119833036000a (patch) | |
tree | 4e6af5185309d7abe49a8fa19634ea38582381e4 /include | |
parent | cd1bb94b4a0531e8211a3774f17de831f8285f76 (diff) |
timers: Logic to move non pinned timers
* Arun R Bharadwaj <arun@linux.vnet.ibm.com> [2009-04-16 12:11:36]:
This patch migrates all non pinned timers and hrtimers to the current
idle load balancer, from all the idle CPUs. Timers firing on busy CPUs
are not migrated.
While migrating hrtimers, care should be taken to check if migrating
a hrtimer would result in a latency or not. So we compare the expiry of the
hrtimer with the next timer interrupt on the target cpu and migrate the
hrtimer only if it expires *after* the next interrupt on the target cpu.
So, added a clockevents_get_next_event() helper function to return the
next_event on the target cpu's clock_event_device.
[ tglx: cleanups and simplifications ]
Signed-off-by: Arun R Bharadwaj <arun@linux.vnet.ibm.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/clockchips.h | 9 | ||||
-rw-r--r-- | include/linux/sched.h | 12 |
2 files changed, 21 insertions, 0 deletions
diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h index 3a1dbba4d3a..20a100fe2b4 100644 --- a/include/linux/clockchips.h +++ b/include/linux/clockchips.h | |||
@@ -143,3 +143,12 @@ extern void clockevents_notify(unsigned long reason, void *arg); | |||
143 | #endif | 143 | #endif |
144 | 144 | ||
145 | #endif | 145 | #endif |
146 | |||
147 | #ifdef CONFIG_GENERIC_CLOCKEVENTS | ||
148 | extern ktime_t clockevents_get_next_event(int cpu); | ||
149 | #else | ||
150 | static inline ktime_t clockevents_get_next_event(int cpu) | ||
151 | { | ||
152 | return (ktime_t) { .tv64 = KTIME_MAX }; | ||
153 | } | ||
154 | #endif | ||
diff --git a/include/linux/sched.h b/include/linux/sched.h index 61850401040..311dec12397 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -257,6 +257,7 @@ extern void task_rq_unlock_wait(struct task_struct *p); | |||
257 | extern cpumask_var_t nohz_cpu_mask; | 257 | extern cpumask_var_t nohz_cpu_mask; |
258 | #if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ) | 258 | #if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ) |
259 | extern int select_nohz_load_balancer(int cpu); | 259 | extern int select_nohz_load_balancer(int cpu); |
260 | extern int get_nohz_load_balancer(void); | ||
260 | #else | 261 | #else |
261 | static inline int select_nohz_load_balancer(int cpu) | 262 | static inline int select_nohz_load_balancer(int cpu) |
262 | { | 263 | { |
@@ -1772,6 +1773,17 @@ int sched_nr_latency_handler(struct ctl_table *table, int write, | |||
1772 | struct file *file, void __user *buffer, size_t *length, | 1773 | struct file *file, void __user *buffer, size_t *length, |
1773 | loff_t *ppos); | 1774 | loff_t *ppos); |
1774 | #endif | 1775 | #endif |
1776 | #ifdef CONFIG_SCHED_DEBUG | ||
1777 | static inline unsigned int get_sysctl_timer_migration(void) | ||
1778 | { | ||
1779 | return sysctl_timer_migration; | ||
1780 | } | ||
1781 | #else | ||
1782 | static inline unsigned int get_sysctl_timer_migration(void) | ||
1783 | { | ||
1784 | return 1; | ||
1785 | } | ||
1786 | #endif | ||
1775 | extern unsigned int sysctl_sched_rt_period; | 1787 | extern unsigned int sysctl_sched_rt_period; |
1776 | extern int sysctl_sched_rt_runtime; | 1788 | extern int sysctl_sched_rt_runtime; |
1777 | 1789 | ||