From: Roman Gushchin <guro@fb.com>
To: <linux-kernel@vger.kernel.org>
Cc: Roman Gushchin <guro@fb.com>, Tejun Heo <tj@kernel.org>,
Oleg Nesterov <oleg@redhat.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
Andrew Morton <akpm@linux-foundation.org>,
Peter Zijlstra <peterz@infradead.org>,
Thomas Gleixner <tglx@linutronix.de>, Chris Mason <clm@fb.com>,
<kernel-team@fb.com>
Subject: [RFC 2/2] cgroup, kthread: cleanup after sticking kthreads to the root cgroup
Date: Thu, 12 Oct 2017 18:37:23 +0100 [thread overview]
Message-ID: <20171012173723.13381-2-guro@fb.com> (raw)
In-Reply-To: <20171012173723.13381-1-guro@fb.com>
Since we're not allowing to move kernel threads out of the root
cgroup anymore, we don't need some infrastructure built to
introduce partial moving ban by
commit 77f88796cee8 ("cgroup, kthread: close race window where
new kthreads can be migrated to non-root cgroups").
This patch is just a cleanup, no functional change
is performed.
Signed-off-by: Roman Gushchin <guro@fb.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Chris Mason <clm@fb.com>
Cc: kernel-team@fb.com
Cc: linux-kernel@vger.kernel.org
---
include/linux/cgroup.h | 21 ---------------------
include/linux/sched.h | 4 ----
kernel/kthread.c | 2 --
3 files changed, 27 deletions(-)
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index 328a70ce0e23..2b2b838beaed 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -626,25 +626,6 @@ static inline void pr_cont_cgroup_path(struct cgroup *cgrp)
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;
-}
-
static inline union kernfs_node_id *cgroup_get_kernfs_id(struct cgroup *cgrp)
{
return &cgrp->kn->id;
@@ -672,8 +653,6 @@ static inline void cgroup_free(struct task_struct *p) {}
static inline int cgroup_init_early(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 union kernfs_node_id *cgroup_get_kernfs_id(struct cgroup *cgrp)
{
return NULL;
diff --git a/include/linux/sched.h b/include/linux/sched.h
index bdd6ad6fcce1..7ee7bad521ff 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -650,10 +650,6 @@ struct task_struct {
#ifdef CONFIG_COMPAT_BRK
unsigned brk_randomized:1;
#endif
-#ifdef CONFIG_CGROUPS
- /* disallow userland-initiated cgroup migration */
- unsigned no_cgroup_migration:1;
-#endif
unsigned long atomic_flags; /* Flags requiring atomic access. */
diff --git a/kernel/kthread.c b/kernel/kthread.c
index e92070878ce5..0ba173e9b5b6 100644
--- a/kernel/kthread.c
+++ b/kernel/kthread.c
@@ -237,7 +237,6 @@ static int kthread(void *_create)
ret = -EINTR;
if (!test_bit(KTHREAD_SHOULD_STOP, &self->flags)) {
- cgroup_kthread_ready();
__kthread_parkme(self);
ret = threadfn(data);
}
@@ -551,7 +550,6 @@ int kthreadd(void *unused)
set_mems_allowed(node_states[N_MEMORY]);
current->flags |= PF_NOFREEZE;
- cgroup_init_kthreadd();
for (;;) {
set_current_state(TASK_INTERRUPTIBLE);
--
2.13.6
next prev parent reply other threads:[~2017-10-12 17:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-12 17:37 [RFC 1/2] cgroup, kthread: do not allow moving kthreads out of the root cgroup Roman Gushchin
2017-10-12 17:37 ` Roman Gushchin [this message]
2017-10-12 19:24 ` Peter Zijlstra
2017-10-12 21:47 ` Roman Gushchin
2017-10-12 21:57 ` David Rientjes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171012173723.13381-2-guro@fb.com \
--to=guro@fb.com \
--cc=akpm@linux-foundation.org \
--cc=clm@fb.com \
--cc=kernel-team@fb.com \
--cc=linux-kernel@vger.kernel.org \
--cc=oleg@redhat.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=tj@kernel.org \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox