From: Waiman Long <longman@redhat.com>
To: Tejun Heo <tj@kernel.org>,
lizefan@huawei.com, hannes@cmpxchg.org, peterz@infradead.org,
mingo@redhat.com
Cc: cgroups@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-team@fb.com, pjt@google.com, luto@amacapital.net,
efault@gmx.de, torvalds@linux-foundation.org, guro@fb.com
Subject: Re: [PATCH 6/6] cgroup: update debug controller to print out thread mode information
Date: Mon, 17 Jul 2017 17:19:16 -0400 [thread overview]
Message-ID: <f6025fbf-bd53-dcd7-a5f7-d7e7a97da788@redhat.com> (raw)
In-Reply-To: <20170717020721.3612468-7-tj@kernel.org>
On 07/16/2017 10:07 PM, Tejun Heo wrote:
> From: Waiman Long <longman@redhat.com>
>
> Update debug controller so that it prints out debug info about thread
> mode.
>
> 1) The relationship between proc_cset and threaded_csets are displayed.
> 2) The status of being a thread root or threaded cgroup is displayed.
>
> This patch is extracted from Waiman's larger patch.
>
> Patch-originally-by: Waiman Long <longman@redhat.com>
> Signed-off-by: Tejun Heo <tj@kernel.org>
> ---
> kernel/cgroup/cgroup-internal.h | 2 ++
> kernel/cgroup/cgroup.c | 4 +--
> kernel/cgroup/debug.c | 58 +++++++++++++++++++++++++++++++----------
> 3 files changed, 48 insertions(+), 16 deletions(-)
>
> diff --git a/kernel/cgroup/cgroup-internal.h b/kernel/cgroup/cgroup-internal.h
> index f10eb19..c167a40 100644
> --- a/kernel/cgroup/cgroup-internal.h
> +++ b/kernel/cgroup/cgroup-internal.h
> @@ -153,6 +153,8 @@ static inline void get_css_set(struct css_set *cset)
>
> bool cgroup_ssid_enabled(int ssid);
> bool cgroup_on_dfl(const struct cgroup *cgrp);
> +bool cgroup_is_thread_root(struct cgroup *cgrp);
> +bool cgroup_is_threaded(struct cgroup *cgrp);
>
> struct cgroup_root *cgroup_root_from_kf(struct kernfs_root *kf_root);
> struct cgroup *task_cgroup_from_root(struct task_struct *task,
> diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
> index 7097ce4..2f34020 100644
> --- a/kernel/cgroup/cgroup.c
> +++ b/kernel/cgroup/cgroup.c
> @@ -333,7 +333,7 @@ static bool cgroup_has_tasks(struct cgroup *cgrp)
> return cgrp->nr_populated_csets;
> }
>
> -static bool cgroup_is_threaded(struct cgroup *cgrp)
> +bool cgroup_is_threaded(struct cgroup *cgrp)
> {
> return cgrp->dom_cgrp != cgrp;
> }
> @@ -372,7 +372,7 @@ static bool cgroup_can_be_thread_root(struct cgroup *cgrp)
> }
>
> /* is @cgrp root of a threaded subtree? */
> -static bool cgroup_is_thread_root(struct cgroup *cgrp)
> +bool cgroup_is_thread_root(struct cgroup *cgrp)
> {
> /* thread root should be a domain */
> if (cgroup_is_threaded(cgrp))
> diff --git a/kernel/cgroup/debug.c b/kernel/cgroup/debug.c
> index dac46af..062904f 100644
> --- a/kernel/cgroup/debug.c
> +++ b/kernel/cgroup/debug.c
> @@ -114,27 +114,54 @@ static int cgroup_css_links_read(struct seq_file *seq, void *v)
> {
> struct cgroup_subsys_state *css = seq_css(seq);
> struct cgrp_cset_link *link;
> - int dead_cnt = 0, extra_refs = 0;
> + int dead_cnt = 0, extra_refs = 0, threaded_csets = 0;
>
> spin_lock_irq(&css_set_lock);
> +
> + if (cgroup_is_thread_root(css->cgroup))
> + seq_puts(seq, "[thread root]\n");
> + else if (cgroup_is_threaded(css->cgroup))
> + seq_puts(seq, "[threaded]\n");
The cgroup status will not be needed anymore as you have introduced the
cgroup.type control file that returns the proper information.
Cheers,
Longman
next prev parent reply other threads:[~2017-07-17 21:19 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-17 2:07 [PATCHSET for-4.13] cgroup: implement cgroup2 thread mode, v3 Tejun Heo
2017-07-17 2:07 ` [PATCH 1/6] cgroup: reorganize cgroup.procs / task write path Tejun Heo
2017-07-17 2:07 ` [PATCH 2/6] cgroup: add @flags to css_task_iter_start() and implement CSS_TASK_ITER_PROCS Tejun Heo
2017-07-17 2:07 ` [PATCH 3/6] cgroup: introduce cgroup->dom_cgrp and threaded css_set handling Tejun Heo
2017-07-17 2:07 ` [PATCH 4/6] cgroup: implement CSS_TASK_ITER_THREADED Tejun Heo
2017-07-17 2:07 ` [PATCH 5/6] cgroup: implement cgroup v2 thread support Tejun Heo
2017-07-17 14:14 ` Peter Zijlstra
2017-07-17 14:26 ` Tejun Heo
2017-07-18 17:28 ` Peter Zijlstra
2017-07-18 17:35 ` Waiman Long
2017-07-18 17:54 ` Tejun Heo
2017-07-18 18:41 ` Peter Zijlstra
2017-07-18 18:47 ` Tejun Heo
2017-07-19 14:07 ` Peter Zijlstra
2017-07-19 16:34 ` Tejun Heo
2017-07-17 20:56 ` Waiman Long
2017-07-18 14:37 ` Waiman Long
2017-07-18 17:10 ` Tejun Heo
2017-07-18 17:23 ` Waiman Long
2017-07-19 16:29 ` Tejun Heo
2017-07-19 17:09 ` Waiman Long
2017-07-19 17:48 ` Tejun Heo
2017-07-17 21:12 ` Waiman Long
2017-07-19 15:40 ` Tejun Heo
2017-07-17 2:07 ` [PATCH 6/6] cgroup: update debug controller to print out thread mode information Tejun Heo
2017-07-17 21:19 ` Waiman Long [this message]
2017-07-19 15:31 ` Tejun Heo
2017-07-19 15:41 ` Waiman Long
2017-07-19 15:44 ` Tejun Heo
2017-07-17 14:48 ` [PATCHSET for-4.13] cgroup: implement cgroup2 thread mode, v3 Waiman Long
2017-07-17 14:51 ` Tejun Heo
2017-07-19 19:44 [PATCHSET for-4.13] cgroup: implement cgroup2 thread mode, v4 Tejun Heo
2017-07-19 19:44 ` [PATCH 6/6] cgroup: update debug controller to print out thread mode information Tejun Heo
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=f6025fbf-bd53-dcd7-a5f7-d7e7a97da788@redhat.com \
--to=longman@redhat.com \
--cc=cgroups@vger.kernel.org \
--cc=efault@gmx.de \
--cc=guro@fb.com \
--cc=hannes@cmpxchg.org \
--cc=kernel-team@fb.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lizefan@huawei.com \
--cc=luto@amacapital.net \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=pjt@google.com \
--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
Powered by JetHome