diff options
Diffstat (limited to 'kernel/kthread.c')
| -rw-r--r-- | kernel/kthread.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/kthread.c b/kernel/kthread.c index 0ac887882f90..bd1b9ea024e1 100644 --- a/kernel/kthread.c +++ b/kernel/kthread.c | |||
| @@ -13,7 +13,6 @@ | |||
| 13 | #include <linux/file.h> | 13 | #include <linux/file.h> |
| 14 | #include <linux/module.h> | 14 | #include <linux/module.h> |
| 15 | #include <linux/mutex.h> | 15 | #include <linux/mutex.h> |
| 16 | #include <asm/semaphore.h> | ||
| 17 | 16 | ||
| 18 | #define KTHREAD_NICE_LEVEL (-5) | 17 | #define KTHREAD_NICE_LEVEL (-5) |
| 19 | 18 | ||
| @@ -99,7 +98,7 @@ static void create_kthread(struct kthread_create_info *create) | |||
| 99 | struct sched_param param = { .sched_priority = 0 }; | 98 | struct sched_param param = { .sched_priority = 0 }; |
| 100 | wait_for_completion(&create->started); | 99 | wait_for_completion(&create->started); |
| 101 | read_lock(&tasklist_lock); | 100 | read_lock(&tasklist_lock); |
| 102 | create->result = find_task_by_pid(pid); | 101 | create->result = find_task_by_pid_ns(pid, &init_pid_ns); |
| 103 | read_unlock(&tasklist_lock); | 102 | read_unlock(&tasklist_lock); |
| 104 | /* | 103 | /* |
| 105 | * root may have changed our (kthreadd's) priority or CPU mask. | 104 | * root may have changed our (kthreadd's) priority or CPU mask. |
| @@ -145,9 +144,9 @@ struct task_struct *kthread_create(int (*threadfn)(void *data), | |||
| 145 | 144 | ||
| 146 | spin_lock(&kthread_create_lock); | 145 | spin_lock(&kthread_create_lock); |
| 147 | list_add_tail(&create.list, &kthread_create_list); | 146 | list_add_tail(&create.list, &kthread_create_list); |
| 148 | wake_up_process(kthreadd_task); | ||
| 149 | spin_unlock(&kthread_create_lock); | 147 | spin_unlock(&kthread_create_lock); |
| 150 | 148 | ||
| 149 | wake_up_process(kthreadd_task); | ||
| 151 | wait_for_completion(&create.done); | 150 | wait_for_completion(&create.done); |
| 152 | 151 | ||
| 153 | if (!IS_ERR(create.result)) { | 152 | if (!IS_ERR(create.result)) { |
| @@ -180,6 +179,7 @@ void kthread_bind(struct task_struct *k, unsigned int cpu) | |||
| 180 | wait_task_inactive(k); | 179 | wait_task_inactive(k); |
| 181 | set_task_cpu(k, cpu); | 180 | set_task_cpu(k, cpu); |
| 182 | k->cpus_allowed = cpumask_of_cpu(cpu); | 181 | k->cpus_allowed = cpumask_of_cpu(cpu); |
| 182 | k->rt.nr_cpus_allowed = 1; | ||
| 183 | } | 183 | } |
| 184 | EXPORT_SYMBOL(kthread_bind); | 184 | EXPORT_SYMBOL(kthread_bind); |
| 185 | 185 | ||
