diff options
author | Bjoern Brandenburg <bbb@mpi-sws.org> | 2015-08-09 07:18:49 -0400 |
---|---|---|
committer | Bjoern Brandenburg <bbb@mpi-sws.org> | 2015-08-09 06:21:19 -0400 |
commit | 0db6e11e49f7bc4893ffff4d8a7af1235894d986 (patch) | |
tree | 062186c38cf5752b550d116d4ad7ece3472e3c34 /arch | |
parent | 4d6bd5eaa2e1e06d0957376d6e49e6b76ca88db5 (diff) |
Integrate preemption state machine with Linux scheduler
Track when a processor is going to schedule "soon".
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/kernel/smp.c | 4 | ||||
-rw-r--r-- | arch/x86/kernel/smp.c | 6 | ||||
-rw-r--r-- | arch/x86/xen/smp.c | 2 |
3 files changed, 12 insertions, 0 deletions
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index cca5b8758185..29a742bbf3ab 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c | |||
@@ -50,6 +50,8 @@ | |||
50 | #define CREATE_TRACE_POINTS | 50 | #define CREATE_TRACE_POINTS |
51 | #include <trace/events/ipi.h> | 51 | #include <trace/events/ipi.h> |
52 | 52 | ||
53 | #include <litmus/preempt.h> | ||
54 | |||
53 | /* | 55 | /* |
54 | * as from 2.5, kernels no longer have an init_tasks structure | 56 | * as from 2.5, kernels no longer have an init_tasks structure |
55 | * so we need some other way of telling a new secondary core | 57 | * so we need some other way of telling a new secondary core |
@@ -593,6 +595,8 @@ void handle_IPI(int ipinr, struct pt_regs *regs) | |||
593 | #endif | 595 | #endif |
594 | 596 | ||
595 | case IPI_RESCHEDULE: | 597 | case IPI_RESCHEDULE: |
598 | /* LITMUS^RT: take action based on scheduler state */ | ||
599 | sched_state_ipi(); | ||
596 | scheduler_ipi(); | 600 | scheduler_ipi(); |
597 | break; | 601 | break; |
598 | 602 | ||
diff --git a/arch/x86/kernel/smp.c b/arch/x86/kernel/smp.c index 7ce9fb210d55..431c3d29a667 100644 --- a/arch/x86/kernel/smp.c +++ b/arch/x86/kernel/smp.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/cpu.h> | 24 | #include <linux/cpu.h> |
25 | #include <linux/gfp.h> | 25 | #include <linux/gfp.h> |
26 | 26 | ||
27 | #include <litmus/preempt.h> | ||
27 | #include <litmus/debug_trace.h> | 28 | #include <litmus/debug_trace.h> |
28 | 29 | ||
29 | #include <asm/mtrr.h> | 30 | #include <asm/mtrr.h> |
@@ -275,6 +276,11 @@ __visible void smp_reschedule_interrupt(struct pt_regs *regs) | |||
275 | /* | 276 | /* |
276 | * KVM uses this interrupt to force a cpu out of guest mode | 277 | * KVM uses this interrupt to force a cpu out of guest mode |
277 | */ | 278 | */ |
279 | |||
280 | /* LITMUS^RT: this IPI might need to trigger the sched state machine. | ||
281 | * Starting from 3.0 schedule_ipi() actually does something. This may | ||
282 | * increase IPI latencies compared with previous versions. */ | ||
283 | sched_state_ipi(); | ||
278 | } | 284 | } |
279 | 285 | ||
280 | static inline void smp_entering_irq(void) | 286 | static inline void smp_entering_irq(void) |
diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c index 86484384492e..517295f6b034 100644 --- a/arch/x86/xen/smp.c +++ b/arch/x86/xen/smp.c | |||
@@ -63,6 +63,8 @@ static irqreturn_t xen_reschedule_interrupt(int irq, void *dev_id) | |||
63 | inc_irq_stat(irq_resched_count); | 63 | inc_irq_stat(irq_resched_count); |
64 | scheduler_ipi(); | 64 | scheduler_ipi(); |
65 | 65 | ||
66 | sched_state_ipi(); | ||
67 | |||
66 | return IRQ_HANDLED; | 68 | return IRQ_HANDLED; |
67 | } | 69 | } |
68 | 70 | ||