diff options
author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2011-07-25 11:43:58 -0400 |
---|---|---|
committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2011-07-25 11:43:58 -0400 |
commit | 899cf6fc2feed3c06d4184406a089dc24de9f6da (patch) | |
tree | 3da9f7451b9b3f5f8c558849ca40ae72244b4b37 | |
parent | 403d52473e4db8604ac559fa4c62ac347a35821c (diff) |
fixup: P-FP migration code
Don't double-lock
-rw-r--r-- | litmus/sched_pfp.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/litmus/sched_pfp.c b/litmus/sched_pfp.c index 7f9a49d9d373..20a7085e8710 100644 --- a/litmus/sched_pfp.c +++ b/litmus/sched_pfp.c | |||
@@ -1162,19 +1162,15 @@ static void pfp_migrate_to(int target_cpu) | |||
1162 | from = task_pfp(t); | 1162 | from = task_pfp(t); |
1163 | to = remote_pfp(target_cpu); | 1163 | to = remote_pfp(target_cpu); |
1164 | 1164 | ||
1165 | if (from < to) { | 1165 | raw_spin_lock(&from->slock); |
1166 | raw_spin_lock(&from->slock); | ||
1167 | raw_spin_lock(&to->slock); | ||
1168 | } else { | ||
1169 | raw_spin_lock(&to->slock); | ||
1170 | raw_spin_lock(&from->slock); | ||
1171 | } | ||
1172 | 1166 | ||
1173 | /* switch partitions */ | 1167 | /* switch partitions */ |
1174 | tsk_rt(t)->task_params.cpu = target_cpu; | 1168 | tsk_rt(t)->task_params.cpu = target_cpu; |
1175 | 1169 | ||
1176 | raw_spin_unlock(&from->slock); | 1170 | raw_spin_unlock(&from->slock); |
1177 | 1171 | ||
1172 | raw_spin_lock(&to->slock); | ||
1173 | |||
1178 | requeue(t, to); | 1174 | requeue(t, to); |
1179 | if (fp_preemption_needed(&to->ready_queue, to->scheduled)) | 1175 | if (fp_preemption_needed(&to->ready_queue, to->scheduled)) |
1180 | preempt(to); | 1176 | preempt(to); |