diff options
| author | Bjoern Brandenburg <bbb@mpi-sws.org> | 2015-10-06 15:44:39 -0400 |
|---|---|---|
| committer | Bjoern Brandenburg <bbb@mpi-sws.org> | 2016-03-08 10:12:45 -0500 |
| commit | 9414feb52855d5446e0d89765f7806deb5cfee08 (patch) | |
| tree | df65cbe516aaa5059fc677ceb694d3610d5367da /kernel/sched | |
| parent | bd415c3ca4f80d9920a624513a164c312a6322c2 (diff) | |
LITMUS^RT: improve integration with fork()
Diffstat (limited to 'kernel/sched')
| -rw-r--r-- | kernel/sched/core.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 13e6056cffbe..cec0e32b5c02 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c | |||
| @@ -1941,6 +1941,8 @@ int sched_fork(unsigned long clone_flags, struct task_struct *p) | |||
| 1941 | */ | 1941 | */ |
| 1942 | p->prio = current->normal_prio; | 1942 | p->prio = current->normal_prio; |
| 1943 | 1943 | ||
| 1944 | litmus_fork(p); | ||
| 1945 | |||
| 1944 | /* | 1946 | /* |
| 1945 | * Revert to default priority/policy on fork if requested. | 1947 | * Revert to default priority/policy on fork if requested. |
| 1946 | */ | 1948 | */ |
| @@ -1963,7 +1965,9 @@ int sched_fork(unsigned long clone_flags, struct task_struct *p) | |||
| 1963 | p->sched_reset_on_fork = 0; | 1965 | p->sched_reset_on_fork = 0; |
| 1964 | } | 1966 | } |
| 1965 | 1967 | ||
| 1966 | if (dl_prio(p->prio)) { | 1968 | if (is_realtime(p)) { |
| 1969 | p->sched_class = &litmus_sched_class; | ||
| 1970 | } else if (dl_prio(p->prio)) { | ||
| 1967 | put_cpu(); | 1971 | put_cpu(); |
| 1968 | return -EAGAIN; | 1972 | return -EAGAIN; |
| 1969 | } else if (rt_prio(p->prio)) { | 1973 | } else if (rt_prio(p->prio)) { |
| @@ -2114,6 +2118,9 @@ void wake_up_new_task(struct task_struct *p) | |||
| 2114 | unsigned long flags; | 2118 | unsigned long flags; |
| 2115 | struct rq *rq; | 2119 | struct rq *rq; |
| 2116 | 2120 | ||
| 2121 | if (is_realtime(p)) | ||
| 2122 | litmus->task_new(p, 1, 0); | ||
| 2123 | |||
| 2117 | raw_spin_lock_irqsave(&p->pi_lock, flags); | 2124 | raw_spin_lock_irqsave(&p->pi_lock, flags); |
| 2118 | #ifdef CONFIG_SMP | 2125 | #ifdef CONFIG_SMP |
| 2119 | /* | 2126 | /* |
