aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern B. Brandenburg <bbb@cs.unc.edu>2008-05-02 11:14:12 -0400
committerBjoern B. Brandenburg <bbb@cs.unc.edu>2008-05-02 11:14:12 -0400
commit9ba6aa51b390e7f1ec301bbf2f064aa9937f6e7f (patch)
tree13f8660962fe555cea69bd9e32ba5521cfdbc870
parent85ea929e767680261d154aebf8b29dad95839d7c (diff)
LITMUS: don't let real-time tasks migrate by themselves
A proper real-time migration works as follows: 1) transition to best-effort task 2) migrate to target CPU 3) update real-time parameters 4) transition to real-time task
-rw-r--r--kernel/sched.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 00097dea89..7268034c88 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -4536,10 +4536,11 @@ long sched_setaffinity(pid_t pid, cpumask_t new_mask)
4536 read_lock(&tasklist_lock); 4536 read_lock(&tasklist_lock);
4537 4537
4538 p = find_process_by_pid(pid); 4538 p = find_process_by_pid(pid);
4539 if (!p) { 4539 if (!p || is_realtime(p)) {
4540 /* LITMUS tasks don't get to do this, transition to BE first */
4540 read_unlock(&tasklist_lock); 4541 read_unlock(&tasklist_lock);
4541 mutex_unlock(&sched_hotcpu_mutex); 4542 mutex_unlock(&sched_hotcpu_mutex);
4542 return -ESRCH; 4543 return p ? -EPERM : -ESRCH;
4543 } 4544 }
4544 4545
4545 /* 4546 /*