aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/smp.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/smp.c')
-rw-r--r--arch/x86/kernel/smp.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/arch/x86/kernel/smp.c b/arch/x86/kernel/smp.c
index d801210945d6..97af589a5c0c 100644
--- a/arch/x86/kernel/smp.c
+++ b/arch/x86/kernel/smp.c
@@ -23,6 +23,9 @@
23#include <linux/cpu.h> 23#include <linux/cpu.h>
24#include <linux/gfp.h> 24#include <linux/gfp.h>
25 25
26#include <litmus/litmus.h>
27#include <litmus/trace.h>
28
26#include <asm/mtrr.h> 29#include <asm/mtrr.h>
27#include <asm/tlbflush.h> 30#include <asm/tlbflush.h>
28#include <asm/mmu_context.h> 31#include <asm/mmu_context.h>
@@ -118,6 +121,7 @@ static void native_smp_send_reschedule(int cpu)
118 WARN_ON(1); 121 WARN_ON(1);
119 return; 122 return;
120 } 123 }
124 TS_SEND_RESCHED_START(cpu);
121 apic->send_IPI_mask(cpumask_of(cpu), RESCHEDULE_VECTOR); 125 apic->send_IPI_mask(cpumask_of(cpu), RESCHEDULE_VECTOR);
122} 126}
123 127
@@ -147,6 +151,16 @@ void native_send_call_func_ipi(const struct cpumask *mask)
147 free_cpumask_var(allbutself); 151 free_cpumask_var(allbutself);
148} 152}
149 153
154/* trigger timers on remote cpu */
155void smp_send_pull_timers(int cpu)
156{
157 if (unlikely(cpu_is_offline(cpu))) {
158 WARN_ON(1);
159 return;
160 }
161 apic->send_IPI_mask(cpumask_of(cpu), PULL_TIMERS_VECTOR);
162}
163
150/* 164/*
151 * this function calls the 'stop' function on all other CPUs in the system. 165 * this function calls the 'stop' function on all other CPUs in the system.
152 */ 166 */
@@ -198,7 +212,12 @@ static void native_smp_send_stop(void)
198void smp_reschedule_interrupt(struct pt_regs *regs) 212void smp_reschedule_interrupt(struct pt_regs *regs)
199{ 213{
200 ack_APIC_irq(); 214 ack_APIC_irq();
215 /* LITMUS^RT needs this interrupt to proper reschedule
216 * on this cpu
217 */
218 set_tsk_need_resched(current);
201 inc_irq_stat(irq_resched_count); 219 inc_irq_stat(irq_resched_count);
220 TS_SEND_RESCHED_END;
202 /* 221 /*
203 * KVM uses this interrupt to force a cpu out of guest mode 222 * KVM uses this interrupt to force a cpu out of guest mode
204 */ 223 */
@@ -222,6 +241,15 @@ void smp_call_function_single_interrupt(struct pt_regs *regs)
222 irq_exit(); 241 irq_exit();
223} 242}
224 243
244extern void hrtimer_pull(void);
245
246void smp_pull_timers_interrupt(struct pt_regs *regs)
247{
248 ack_APIC_irq();
249 TRACE("pull timer interrupt\n");
250 hrtimer_pull();
251}
252
225struct smp_ops smp_ops = { 253struct smp_ops smp_ops = {
226 .smp_prepare_boot_cpu = native_smp_prepare_boot_cpu, 254 .smp_prepare_boot_cpu = native_smp_prepare_boot_cpu,
227 .smp_prepare_cpus = native_smp_prepare_cpus, 255 .smp_prepare_cpus = native_smp_prepare_cpus,