From: Peter Zijlstra <peterz@infradead.org>
To: Suren Baghdasaryan <surenb@google.com>
Cc: tj@kernel.org, hannes@cmpxchg.org, lizefan.x@bytedance.com,
mingo@redhat.com, juri.lelli@redhat.com,
vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de,
minchan@kernel.org, corbet@lwn.net, bristot@redhat.com,
paulmck@kernel.org, rdunlap@infradead.org,
akpm@linux-foundation.org, tglx@linutronix.de, macro@orcam.me.uk,
viresh.kumar@linaro.org, mike.kravetz@oracle.com,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
cgroups@vger.kernel.org, kernel-team@android.com
Subject: Re: [PATCH 1/1] cgroup: make per-cgroup pressure stall tracking configurable
Date: Fri, 14 May 2021 13:41:54 +0200 [thread overview]
Message-ID: <YJ5iAvqAmIhzJRot@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20210513175349.959661-1-surenb@google.com>
On Thu, May 13, 2021 at 10:53:49AM -0700, Suren Baghdasaryan wrote:
> +bool cgroup_psi_enabled(void)
> +{
> + return (cgroup_feature_disable_mask & (1 << OPT_FEATURE_PRESSURE)) == 0;
> +}
> diff --git a/kernel/sched/psi.c b/kernel/sched/psi.c
> index cc25a3cff41f..c73efd7d4fba 100644
> --- a/kernel/sched/psi.c
> +++ b/kernel/sched/psi.c
> @@ -747,9 +747,12 @@ static struct psi_group *iterate_groups(struct task_struct *task, void **iter)
> #ifdef CONFIG_CGROUPS
> struct cgroup *cgroup = NULL;
>
> - if (!*iter)
> + if (!*iter) {
> + /* Skip to psi_system if per-cgroup accounting is disabled */
> + if (!cgroup_psi_enabled())
> + goto update_sys;
> cgroup = task->cgroups->dfl_cgrp;
> - else if (*iter == &psi_system)
> + } else if (*iter == &psi_system)
> return NULL;
> else
> cgroup = cgroup_parent(*iter);
> @@ -758,6 +761,7 @@ static struct psi_group *iterate_groups(struct task_struct *task, void **iter)
> *iter = cgroup;
> return cgroup_psi(cgroup);
> }
> +update_sys:
> #else
> if (*iter)
> return NULL;
I'm confused; shouldn't that do the same as that #else branch? Also, can
you pretty please make cgroup_psi_enabled() a static_key ?
next prev parent reply other threads:[~2021-05-14 11:42 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-13 17:53 [PATCH 1/1] cgroup: make per-cgroup pressure stall tracking configurable Suren Baghdasaryan
2021-05-14 11:41 ` Peter Zijlstra [this message]
2021-05-14 15:54 ` Suren Baghdasaryan
2021-05-14 17:52 ` Peter Zijlstra
2021-05-14 18:20 ` Suren Baghdasaryan
2021-05-14 18:50 ` Suren Baghdasaryan
2021-05-16 19:52 ` Suren Baghdasaryan
2021-05-17 18:31 ` Johannes Weiner
2021-05-17 20:02 ` Suren Baghdasaryan
2021-05-18 2:05 ` Suren Baghdasaryan
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=YJ5iAvqAmIhzJRot@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=bristot@redhat.com \
--cc=bsegall@google.com \
--cc=cgroups@vger.kernel.org \
--cc=corbet@lwn.net \
--cc=dietmar.eggemann@arm.com \
--cc=hannes@cmpxchg.org \
--cc=juri.lelli@redhat.com \
--cc=kernel-team@android.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lizefan.x@bytedance.com \
--cc=macro@orcam.me.uk \
--cc=mgorman@suse.de \
--cc=mike.kravetz@oracle.com \
--cc=minchan@kernel.org \
--cc=mingo@redhat.com \
--cc=paulmck@kernel.org \
--cc=rdunlap@infradead.org \
--cc=rostedt@goodmis.org \
--cc=surenb@google.com \
--cc=tglx@linutronix.de \
--cc=tj@kernel.org \
--cc=vincent.guittot@linaro.org \
--cc=viresh.kumar@linaro.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;
as well as URLs for NNTP newsgroup(s).