Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.6.26-rc1 /kernel/kthread.c

Filename:/kernel/kthread.c
Lines Added:3
Lines Deleted:3
Also changed in: (Previous) 2.6.25-git20  2.6.25-git19  2.6.25-git18  2.6.25-git17  2.6.25-git16  2.6.25-git15 
(Following) 2.6.26-rc2  2.6.26-rc3  2.6.26-rc4  2.6.26-rc5  2.6.26-rc6  2.6.26-rc7 

Location
[  2.6.26-rc1
  [  kernel
     o  kthread.c

Patch

diff --git a/kernel/kthread.c b/kernel/kthread.c
index 0ac8878..bd1b9ea 100644
--- a/kernel/kthread.c
+++ b/kernel/kthread.c
@@ -13,7 +13,6 @@
 #include <linux/file.h>
 #include <linux/module.h>
 #include <linux/mutex.h>
-#include <asm/semaphore.h>
 
 #define KTHREAD_NICE_LEVEL (-5)
 
@@ -99,7 +98,7 @@ static void create_kthread(struct kthread_create_info *create)
       struct sched_param param = { .sched_priority = 0 };
       wait_for_completion(&create->started);
       read_lock(&tasklist_lock);
-      create->result = find_task_by_pid(pid);
+      create->result = find_task_by_pid_ns(pid, &init_pid_ns);
       read_unlock(&tasklist_lock);
       /*
        * root may have changed our (kthreadd's) priority or CPU mask.
@@ -145,9 +144,9 @@ struct task_struct *kthread_create(int (*threadfn)(void *data),
 
    spin_lock(&kthread_create_lock);
    list_add_tail(&create.list, &kthread_create_list);
-   wake_up_process(kthreadd_task);
    spin_unlock(&kthread_create_lock);
 
+   wake_up_process(kthreadd_task);
    wait_for_completion(&create.done);
 
    if (!IS_ERR(create.result)) {
@@ -180,6 +179,7 @@ void kthread_bind(struct task_struct *k, unsigned int cpu)
    wait_task_inactive(k);
    set_task_cpu(k, cpu);
    k->cpus_allowed = cpumask_of_cpu(cpu);
+   k->rt.nr_cpus_allowed = 1;
 }
 EXPORT_SYMBOL(kthread_bind);
 


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.