aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern Brandenburg <bbb@mpi-sws.org>2012-09-06 09:14:10 -0400
committerBjoern Brandenburg <bbb@mpi-sws.org>2012-10-18 16:14:06 -0400
commitd940d731de7c4c98e47d526d08064035893dbeed (patch)
treefa951fdc7ad0b58873fde5403e8fc9b0233ede94
parentce313ac8c1531c11d670fd84fe2526bbb5f32f85 (diff)
Move SEND_RESCHED tracing to preempt.c
The SEND_RESCHED is really only interesting if the IPI was generated by LITMUS^RT. Therefore, we don't need to trace in Linux's architecture-specific code. Instead, we hook into the preemption state machine, which is informed about incoming IPIs anyway.
-rw-r--r--arch/x86/kernel/smp.c14
-rw-r--r--litmus/preempt.c6
2 files changed, 10 insertions, 10 deletions
diff --git a/arch/x86/kernel/smp.c b/arch/x86/kernel/smp.c
index f5e294040b1c..7539d84628f7 100644
--- a/arch/x86/kernel/smp.c
+++ b/arch/x86/kernel/smp.c
@@ -25,7 +25,6 @@
25 25
26#include <litmus/preempt.h> 26#include <litmus/preempt.h>
27#include <litmus/debug_trace.h> 27#include <litmus/debug_trace.h>
28#include <litmus/trace.h>
29 28
30#include <asm/mtrr.h> 29#include <asm/mtrr.h>
31#include <asm/tlbflush.h> 30#include <asm/tlbflush.h>
@@ -122,7 +121,6 @@ static void native_smp_send_reschedule(int cpu)
122 WARN_ON(1); 121 WARN_ON(1);
123 return; 122 return;
124 } 123 }
125 TS_SEND_RESCHED_START(cpu);
126 apic->send_IPI_mask(cpumask_of(cpu), RESCHEDULE_VECTOR); 124 apic->send_IPI_mask(cpumask_of(cpu), RESCHEDULE_VECTOR);
127} 125}
128 126
@@ -214,18 +212,16 @@ static void native_stop_other_cpus(int wait)
214void smp_reschedule_interrupt(struct pt_regs *regs) 212void smp_reschedule_interrupt(struct pt_regs *regs)
215{ 213{
216 ack_APIC_irq(); 214 ack_APIC_irq();
217 /* LITMUS^RT: this IPI might need to trigger the sched state machine. */
218 sched_state_ipi();
219 inc_irq_stat(irq_resched_count); 215 inc_irq_stat(irq_resched_count);
220 /*
221 * LITMUS^RT: starting from 3.0 schedule_ipi() actually does something.
222 * This may increase IPI latencies compared with previous versions.
223 */
224 scheduler_ipi(); 216 scheduler_ipi();
225 TS_SEND_RESCHED_END;
226 /* 217 /*
227 * KVM uses this interrupt to force a cpu out of guest mode 218 * KVM uses this interrupt to force a cpu out of guest mode
228 */ 219 */
220
221 /* LITMUS^RT: this IPI might need to trigger the sched state machine.
222 * Starting from 3.0 schedule_ipi() actually does something. This may
223 * increase IPI latencies compared with previous versions. */
224 sched_state_ipi();
229} 225}
230 226
231void smp_call_function_interrupt(struct pt_regs *regs) 227void smp_call_function_interrupt(struct pt_regs *regs)
diff --git a/litmus/preempt.c b/litmus/preempt.c
index 5704d0bf4c0b..6be2f26728b8 100644
--- a/litmus/preempt.c
+++ b/litmus/preempt.c
@@ -2,6 +2,7 @@
2 2
3#include <litmus/litmus.h> 3#include <litmus/litmus.h>
4#include <litmus/preempt.h> 4#include <litmus/preempt.h>
5#include <litmus/trace.h>
5 6
6/* The rescheduling state of each processor. 7/* The rescheduling state of each processor.
7 */ 8 */
@@ -47,6 +48,7 @@ void sched_state_ipi(void)
47 set_tsk_need_resched(current); 48 set_tsk_need_resched(current);
48 TRACE_STATE("IPI -> set_tsk_need_resched(%s/%d)\n", 49 TRACE_STATE("IPI -> set_tsk_need_resched(%s/%d)\n",
49 current->comm, current->pid); 50 current->comm, current->pid);
51 TS_SEND_RESCHED_END;
50 } else { 52 } else {
51 /* ignore */ 53 /* ignore */
52 TRACE_STATE("ignoring IPI in state %x (%s)\n", 54 TRACE_STATE("ignoring IPI in state %x (%s)\n",
@@ -85,8 +87,10 @@ void litmus_reschedule(int cpu)
85 if (scheduled_transition_ok) { 87 if (scheduled_transition_ok) {
86 if (smp_processor_id() == cpu) 88 if (smp_processor_id() == cpu)
87 set_tsk_need_resched(current); 89 set_tsk_need_resched(current);
88 else 90 else {
91 TS_SEND_RESCHED_START(cpu);
89 smp_send_reschedule(cpu); 92 smp_send_reschedule(cpu);
93 }
90 } 94 }
91 95
92 TRACE_STATE("%s picked-ok:%d sched-ok:%d\n", 96 TRACE_STATE("%s picked-ok:%d sched-ok:%d\n",