aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorPratyush Patel <pratyushpatel.1995@gmail.com>2016-02-07 22:11:15 -0500
committerPratyush Patel <pratyushpatel.1995@gmail.com>2016-02-07 22:11:15 -0500
commitce90c1d314b15359d0595918c7dfa0ec1f5b9bb6 (patch)
tree6b20f5f040857a36f7696328e4029f7cb94dc98d /kernel
parent3b688190e1d840b8357aae765911f0f00621e26f (diff)
Revert "Add hrtimer_start_on() support"
This reverts commit 5014e7011964ff46b2d73cf91a05ed9eed5a8fa2.
Diffstat (limited to 'kernel')
-rw-r--r--kernel/time/hrtimer.c95
1 files changed, 0 insertions, 95 deletions
diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
index d5a8e4db0bf9..bb281cfa31e9 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -50,8 +50,6 @@
50#include <linux/timer.h> 50#include <linux/timer.h>
51#include <linux/freezer.h> 51#include <linux/freezer.h>
52 52
53#include <litmus/debug_trace.h>
54
55#include <asm/uaccess.h> 53#include <asm/uaccess.h>
56 54
57#include <trace/events/timer.h> 55#include <trace/events/timer.h>
@@ -1049,98 +1047,6 @@ hrtimer_start(struct hrtimer *timer, ktime_t tim, const enum hrtimer_mode mode)
1049} 1047}
1050EXPORT_SYMBOL_GPL(hrtimer_start); 1048EXPORT_SYMBOL_GPL(hrtimer_start);
1051 1049
1052#if defined(CONFIG_ARCH_HAS_SEND_PULL_TIMERS) && defined(CONFIG_SMP)
1053
1054/**
1055 * hrtimer_start_on_info_init - Initialize hrtimer_start_on_info
1056 */
1057void hrtimer_start_on_info_init(struct hrtimer_start_on_info *info)
1058{
1059 memset(info, 0, sizeof(struct hrtimer_start_on_info));
1060 atomic_set(&info->state, HRTIMER_START_ON_INACTIVE);
1061}
1062
1063/**
1064 * hrtimer_pull - PULL_TIMERS_VECTOR callback on remote cpu
1065 */
1066void hrtimer_pull(void)
1067{
1068 struct hrtimer_cpu_base *base = this_cpu_ptr(&hrtimer_bases);
1069 struct hrtimer_start_on_info *info;
1070 struct list_head *pos, *safe, list;
1071
1072 raw_spin_lock(&base->lock);
1073 list_replace_init(&base->to_pull, &list);
1074 raw_spin_unlock(&base->lock);
1075
1076 list_for_each_safe(pos, safe, &list) {
1077 info = list_entry(pos, struct hrtimer_start_on_info, list);
1078 TRACE("pulled timer 0x%x\n", info->timer);
1079 list_del(pos);
1080 hrtimer_start(info->timer, info->time, info->mode);
1081 }
1082}
1083
1084/**
1085 * hrtimer_start_on - trigger timer arming on remote cpu
1086 * @cpu: remote cpu
1087 * @info: save timer information for enqueuing on remote cpu
1088 * @timer: timer to be pulled
1089 * @time: expire time
1090 * @mode: timer mode
1091 */
1092int hrtimer_start_on(int cpu, struct hrtimer_start_on_info* info,
1093 struct hrtimer *timer, ktime_t time,
1094 const enum hrtimer_mode mode)
1095{
1096 unsigned long flags;
1097 struct hrtimer_cpu_base* base;
1098 int in_use = 0, was_empty;
1099
1100 /* serialize access to info through the timer base */
1101 lock_hrtimer_base(timer, &flags);
1102
1103 in_use = (atomic_read(&info->state) != HRTIMER_START_ON_INACTIVE);
1104 if (!in_use) {
1105 INIT_LIST_HEAD(&info->list);
1106 info->timer = timer;
1107 info->time = time;
1108 info->mode = mode;
1109 /* mark as in use */
1110 atomic_set(&info->state, HRTIMER_START_ON_QUEUED);
1111 }
1112
1113 unlock_hrtimer_base(timer, &flags);
1114
1115 if (!in_use) {
1116 /* initiate pull */
1117 preempt_disable();
1118 if (cpu == smp_processor_id()) {
1119 /* start timer locally; we may get called
1120 * with rq->lock held, do not wake up anything
1121 */
1122 TRACE("hrtimer_start_on: starting on local CPU\n");
1123 __hrtimer_start_range_ns(info->timer, info->time,
1124 0, info->mode, 0);
1125 } else {
1126 TRACE("hrtimer_start_on: pulling to remote CPU\n");
1127 base = &per_cpu(hrtimer_bases, cpu);
1128 raw_spin_lock_irqsave(&base->lock, flags);
1129 was_empty = list_empty(&base->to_pull);
1130 list_add(&info->list, &base->to_pull);
1131 raw_spin_unlock_irqrestore(&base->lock, flags);
1132 if (was_empty)
1133 /* only send IPI if other no else
1134 * has done so already
1135 */
1136 smp_send_pull_timers(cpu);
1137 }
1138 preempt_enable();
1139 }
1140 return in_use;
1141}
1142
1143#endif
1144 1050
1145/** 1051/**
1146 * hrtimer_try_to_cancel - try to deactivate a timer 1052 * hrtimer_try_to_cancel - try to deactivate a timer
@@ -1722,7 +1628,6 @@ static void init_hrtimers_cpu(int cpu)
1722 1628
1723 cpu_base->cpu = cpu; 1629 cpu_base->cpu = cpu;
1724 hrtimer_init_hres(cpu_base); 1630 hrtimer_init_hres(cpu_base);
1725 INIT_LIST_HEAD(&cpu_base->to_pull);
1726} 1631}
1727 1632
1728#ifdef CONFIG_HOTPLUG_CPU 1633#ifdef CONFIG_HOTPLUG_CPU