diff options
-rw-r--r-- | litmus/sched_gsn_edf.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/litmus/sched_gsn_edf.c b/litmus/sched_gsn_edf.c index 90ff6f639461..66ffa3e7a7bd 100644 --- a/litmus/sched_gsn_edf.c +++ b/litmus/sched_gsn_edf.c | |||
@@ -280,6 +280,18 @@ static void check_for_preemptions(void) | |||
280 | { | 280 | { |
281 | struct task_struct *task; | 281 | struct task_struct *task; |
282 | cpu_entry_t *last; | 282 | cpu_entry_t *last; |
283 | cpu_entry_t *local; | ||
284 | |||
285 | /* Before linking to other CPUs, check first whether the local CPU is | ||
286 | * idle. */ | ||
287 | local = &__get_cpu_var(gsnedf_cpu_entries); | ||
288 | task = __peek_ready(&gsnedf); | ||
289 | if (task && !local->linked) { | ||
290 | task = __take_ready(&gsnedf); | ||
291 | TRACE_TASK(task, "linking to local CPU %d to avoid IPI\n", local->cpu); | ||
292 | link_task_to_cpu(task, local); | ||
293 | preempt(local); | ||
294 | } | ||
283 | 295 | ||
284 | for (last = lowest_prio_cpu(); | 296 | for (last = lowest_prio_cpu(); |
285 | edf_preemption_needed(&gsnedf, last->linked); | 297 | edf_preemption_needed(&gsnedf, last->linked); |