|
@@ -570,6 +570,25 @@ static inline void pr_cont_cgroup_path(struct cgroup *cgrp)
|
|
pr_cont_kernfs_path(cgrp->kn);
|
|
pr_cont_kernfs_path(cgrp->kn);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static inline void cgroup_init_kthreadd(void)
|
|
|
|
+{
|
|
|
|
+ /*
|
|
|
|
+ * kthreadd is inherited by all kthreads, keep it in the root so
|
|
|
|
+ * that the new kthreads are guaranteed to stay in the root until
|
|
|
|
+ * initialization is finished.
|
|
|
|
+ */
|
|
|
|
+ current->no_cgroup_migration = 1;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static inline void cgroup_kthread_ready(void)
|
|
|
|
+{
|
|
|
|
+ /*
|
|
|
|
+ * This kthread finished initialization. The creator should have
|
|
|
|
+ * set PF_NO_SETAFFINITY if this kthread should stay in the root.
|
|
|
|
+ */
|
|
|
|
+ current->no_cgroup_migration = 0;
|
|
|
|
+}
|
|
|
|
+
|
|
#else /* !CONFIG_CGROUPS */
|
|
#else /* !CONFIG_CGROUPS */
|
|
|
|
|
|
struct cgroup_subsys_state;
|
|
struct cgroup_subsys_state;
|
|
@@ -590,6 +609,8 @@ static inline void cgroup_free(struct task_struct *p) {}
|
|
|
|
|
|
static inline int cgroup_init_early(void) { return 0; }
|
|
static inline int cgroup_init_early(void) { return 0; }
|
|
static inline int cgroup_init(void) { return 0; }
|
|
static inline int cgroup_init(void) { return 0; }
|
|
|
|
+static inline void cgroup_init_kthreadd(void) {}
|
|
|
|
+static inline void cgroup_kthread_ready(void) {}
|
|
|
|
|
|
static inline bool task_under_cgroup_hierarchy(struct task_struct *task,
|
|
static inline bool task_under_cgroup_hierarchy(struct task_struct *task,
|
|
struct cgroup *ancestor)
|
|
struct cgroup *ancestor)
|