diff options
author | Bjoern Brandenburg <bbb@mpi-sws.org> | 2013-06-25 01:30:56 -0400 |
---|---|---|
committer | Bjoern Brandenburg <bbb@mpi-sws.org> | 2013-08-07 03:46:51 -0400 |
commit | 15a3dd60f0dc56db35d3335e7ea0ea8ab67eedfb (patch) | |
tree | f34e044fe45e8832891486c822c3eae4bcfd0ca5 /arch | |
parent | 8f88280b7201efb67751b904728d7c8ed9786f93 (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 |
2 files changed, 10 insertions, 0 deletions
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index 5919eb451bb9..1a945e27d310 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c | |||
@@ -46,6 +46,8 @@ | |||
46 | #include <asm/virt.h> | 46 | #include <asm/virt.h> |
47 | #include <asm/mach/arch.h> | 47 | #include <asm/mach/arch.h> |
48 | 48 | ||
49 | #include <litmus/preempt.h> | ||
50 | |||
49 | /* | 51 | /* |
50 | * as from 2.5, kernels no longer have an init_tasks structure | 52 | * as from 2.5, kernels no longer have an init_tasks structure |
51 | * so we need some other way of telling a new secondary core | 53 | * so we need some other way of telling a new secondary core |
@@ -617,6 +619,8 @@ void handle_IPI(int ipinr, struct pt_regs *regs) | |||
617 | #endif | 619 | #endif |
618 | 620 | ||
619 | case IPI_RESCHEDULE: | 621 | case IPI_RESCHEDULE: |
622 | /* LITMUS^RT: take action based on scheduler state */ | ||
623 | sched_state_ipi(); | ||
620 | scheduler_ipi(); | 624 | scheduler_ipi(); |
621 | break; | 625 | break; |
622 | 626 | ||
diff --git a/arch/x86/kernel/smp.c b/arch/x86/kernel/smp.c index a52ef7fd6862..becf5c332d19 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> |
@@ -269,6 +270,11 @@ void smp_reschedule_interrupt(struct pt_regs *regs) | |||
269 | /* | 270 | /* |
270 | * KVM uses this interrupt to force a cpu out of guest mode | 271 | * KVM uses this interrupt to force a cpu out of guest mode |
271 | */ | 272 | */ |
273 | |||
274 | /* LITMUS^RT: this IPI might need to trigger the sched state machine. | ||
275 | * Starting from 3.0 schedule_ipi() actually does something. This may | ||
276 | * increase IPI latencies compared with previous versions. */ | ||
277 | sched_state_ipi(); | ||
272 | } | 278 | } |
273 | 279 | ||
274 | void smp_call_function_interrupt(struct pt_regs *regs) | 280 | void smp_call_function_interrupt(struct pt_regs *regs) |