diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
commit | c71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch) | |
tree | ecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /litmus/sched_plugin.c | |
parent | ea53c912f8a86a8567697115b6a0d8152beee5c8 (diff) | |
parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) |
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts:
litmus/sched_cedf.c
Diffstat (limited to 'litmus/sched_plugin.c')
-rw-r--r-- | litmus/sched_plugin.c | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/litmus/sched_plugin.c b/litmus/sched_plugin.c index d54886df1f57..00a1900d6457 100644 --- a/litmus/sched_plugin.c +++ b/litmus/sched_plugin.c | |||
@@ -35,29 +35,18 @@ void preempt_if_preemptable(struct task_struct* t, int cpu) | |||
35 | /* local CPU case */ | 35 | /* local CPU case */ |
36 | /* check if we need to poke userspace */ | 36 | /* check if we need to poke userspace */ |
37 | if (is_user_np(t)) | 37 | if (is_user_np(t)) |
38 | /* yes, poke it */ | 38 | /* Yes, poke it. This doesn't have to be atomic since |
39 | * the task is definitely not executing. */ | ||
39 | request_exit_np(t); | 40 | request_exit_np(t); |
40 | else if (!is_kernel_np(t)) | 41 | else if (!is_kernel_np(t)) |
41 | /* only if we are allowed to preempt the | 42 | /* only if we are allowed to preempt the |
42 | * currently-executing task */ | 43 | * currently-executing task */ |
43 | reschedule = 1; | 44 | reschedule = 1; |
44 | } else { | 45 | } else { |
45 | /* remote CPU case */ | 46 | /* Remote CPU case. Only notify if it's not a kernel |
46 | if (is_user_np(t)) { | 47 | * NP section and if we didn't set the userspace |
47 | /* need to notify user space of delayed | 48 | * flag. */ |
48 | * preemption */ | 49 | reschedule = !(is_kernel_np(t) || request_exit_np_atomic(t)); |
49 | |||
50 | /* to avoid a race, set the flag, then test | ||
51 | * again */ | ||
52 | request_exit_np(t); | ||
53 | /* make sure it got written */ | ||
54 | mb(); | ||
55 | } | ||
56 | /* Only send an ipi if remote task might have raced our | ||
57 | * request, i.e., send an IPI to make sure in case it | ||
58 | * exited its critical section. | ||
59 | */ | ||
60 | reschedule = !is_np(t) && !is_kernel_np(t); | ||
61 | } | 50 | } |
62 | } | 51 | } |
63 | if (likely(reschedule)) | 52 | if (likely(reschedule)) |