Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-android
[firefly-linux-kernel-4.4.55.git] / kernel / kthread.c
index 9ff173dca1aef5e09fd640dc6757fee99c7a956c..850b255649a2175936317aaa1d91fa5c2d58681d 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/freezer.h>
 #include <linux/ptrace.h>
 #include <linux/uaccess.h>
+#include <linux/cgroup.h>
 #include <trace/events/sched.h>
 
 static DEFINE_SPINLOCK(kthread_create_lock);
@@ -205,6 +206,7 @@ static int kthread(void *_create)
        ret = -EINTR;
 
        if (!test_bit(KTHREAD_SHOULD_STOP, &self.flags)) {
+               cgroup_kthread_ready();
                __kthread_parkme(&self);
                ret = threadfn(data);
        }
@@ -510,6 +512,7 @@ int kthreadd(void *unused)
        set_mems_allowed(node_states[N_MEMORY]);
 
        current->flags |= PF_NOFREEZE;
+       cgroup_init_kthreadd();
 
        for (;;) {
                set_current_state(TASK_INTERRUPTIBLE);