]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - kernel/kthread.c
xtensa: use DATA_DATA in xtensa
[linux-2.6-omap-h63xx.git] / kernel / kthread.c
index 0eb0070a3c57cd76a3b5ac9c0857dd4b04a6f351..a404f7ee73959a154fddca8b59c5bb79db1773be 100644 (file)
@@ -70,7 +70,7 @@ static int kthread(void *_create)
        data = create->data;
 
        /* OK, tell user we're spawned, wait for stop or wakeup */
-       __set_current_state(TASK_INTERRUPTIBLE);
+       __set_current_state(TASK_UNINTERRUPTIBLE);
        complete(&create->started);
        schedule();
 
@@ -162,7 +162,10 @@ EXPORT_SYMBOL(kthread_create);
  */
 void kthread_bind(struct task_struct *k, unsigned int cpu)
 {
-       BUG_ON(k->state != TASK_INTERRUPTIBLE);
+       if (k->state != TASK_UNINTERRUPTIBLE) {
+               WARN_ON(1);
+               return;
+       }
        /* Must have done schedule() in kthread() before we set_task_cpu */
        wait_task_inactive(k);
        set_task_cpu(k, cpu);
@@ -212,27 +215,16 @@ int kthread_stop(struct task_struct *k)
 EXPORT_SYMBOL(kthread_stop);
 
 
-static __init void kthreadd_setup(void)
+static noinline __init_refok void kthreadd_setup(void)
 {
        struct task_struct *tsk = current;
-       struct k_sigaction sa;
-       sigset_t blocked;
 
        set_task_comm(tsk, "kthreadd");
 
-       /* Block and flush all signals */
-       sigfillset(&blocked);
-       sigprocmask(SIG_BLOCK, &blocked, NULL);
-       flush_signals(tsk);
-
-       /* SIG_IGN makes children autoreap: see do_notify_parent(). */
-       sa.sa.sa_handler = SIG_IGN;
-       sa.sa.sa_flags = 0;
-       siginitset(&sa.sa.sa_mask, sigmask(SIGCHLD));
-       do_sigaction(SIGCHLD, &sa, (struct k_sigaction *)0);
+       ignore_signals(tsk);
 
-       set_user_nice(current, -5);
-       set_cpus_allowed(current, CPU_MASK_ALL);
+       set_user_nice(tsk, -5);
+       set_cpus_allowed(tsk, CPU_MASK_ALL);
 }
 
 int kthreadd(void *unused)