From: Namhyung Kim <namhyung-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Peter Zijlstra <peterz-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
Ingo Molnar <mingo-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Will Deacon <will-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Waiman Long <longman-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
Boqun Feng <boqun.feng-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: LKML <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Thomas Gleixner <tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>,
Steven Rostedt <rostedt-nx8X9YLhiw1AfugRpC6u6w@public.gmane.org>,
Byungchul Park <byungchul.park-Hm3cg6mZ9cc@public.gmane.org>,
"Paul E. McKenney"
<paulmck-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Mathieu Desnoyers
<mathieu.desnoyers-vg+e7yoeK/dWk0Htik3J/w@public.gmane.org>,
Radoslaw Burny <rburny-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
Zefan Li <lizefan.x-EC8Uxl6Npydl57MIdRCFDg@public.gmane.org>,
Johannes Weiner <hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>,
cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Subject: [PATCH 02/12] cgroup: rstat: Make cgroup_rstat_cpu_lock name readable
Date: Tue, 8 Feb 2022 11:43:14 -0800 [thread overview]
Message-ID: <20220208194324.85333-3-namhyung@kernel.org> (raw)
In-Reply-To: <20220208194324.85333-1-namhyung-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
The raw_spin_lock_init() uses the argument to name its lockdep map.
But passing per_cpu_ptr() macro directly makes it a very very long
name as it expanded like below:
({ do { const void *__vpp_verify = (typeof((&cgroup_rstat_cpu_lock) ...
Let's fix it by passing a local variable instead. With this change,
the name now looks like:
cgrp_rstat_cpu_lock
Cc: Zefan Li <lizefan.x-EC8Uxl6Npydl57MIdRCFDg@public.gmane.org>
Cc: Johannes Weiner <hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
Cc: cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Acked-by: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Signed-off-by: Namhyung Kim <namhyung-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
---
kernel/cgroup/rstat.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/kernel/cgroup/rstat.c b/kernel/cgroup/rstat.c
index 9d331ba44870..371f54a59c38 100644
--- a/kernel/cgroup/rstat.c
+++ b/kernel/cgroup/rstat.c
@@ -286,9 +286,17 @@ void cgroup_rstat_exit(struct cgroup *cgrp)
void __init cgroup_rstat_boot(void)
{
int cpu;
+ raw_spinlock_t *cgrp_rstat_cpu_lock;
- for_each_possible_cpu(cpu)
- raw_spin_lock_init(per_cpu_ptr(&cgroup_rstat_cpu_lock, cpu));
+ for_each_possible_cpu(cpu) {
+ /*
+ * raw_spin_lock_init() uses the argument to name the lock in
+ * lockdep results. Passing per_cpu_ptr() directly created a
+ * cryptic name as the macro was expanded before stringified.
+ */
+ cgrp_rstat_cpu_lock = per_cpu_ptr(&cgroup_rstat_cpu_lock, cpu);
+ raw_spin_lock_init(cgrp_rstat_cpu_lock);
+ }
}
/*
--
2.35.0.263.gb82422642f-goog
next prev parent reply other threads:[~2022-02-08 19:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-08 19:43 [RFC RESEND 00/12] locking: Separate lock tracepoints from lockdep/lock_stat (v1.1) Namhyung Kim
[not found] ` <20220208194324.85333-1-namhyung-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2022-02-08 19:43 ` Namhyung Kim [this message]
[not found] ` <20220208194324.85333-3-namhyung-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2022-02-09 20:20 ` [PATCH 02/12] cgroup: rstat: Make cgroup_rstat_cpu_lock name readable Waiman Long
[not found] ` <4b58c74d-6ad6-3658-30fb-1957a7b212dc-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2022-02-09 23:29 ` Tejun Heo
-- strict thread matches above, loose matches on Subject: below --
2022-02-08 18:41 [RFC 00/12] locking: Separate lock tracepoints from lockdep/lock_stat (v1) Namhyung Kim
[not found] ` <20220208184208.79303-1-namhyung-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2022-02-08 18:41 ` [PATCH 02/12] cgroup: rstat: Make cgroup_rstat_cpu_lock name readable Namhyung Kim
2022-02-08 18:46 ` Tejun Heo
[not found] ` <YgK6k4TXnRbm02dh-NiLfg/pYEd1N0TnZuCh8vA@public.gmane.org>
2022-02-08 19:16 ` Namhyung Kim
[not found] ` <CAM9d7cgKLycpFuXq0VgC=ADtAipXtKdfRcDqvZwMrNBz7hXd7A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2022-02-08 23:51 ` Namhyung Kim
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=20220208194324.85333-3-namhyung@kernel.org \
--to=namhyung-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
--cc=boqun.feng-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=byungchul.park-Hm3cg6mZ9cc@public.gmane.org \
--cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=lizefan.x-EC8Uxl6Npydl57MIdRCFDg@public.gmane.org \
--cc=longman-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=mathieu.desnoyers-vg+e7yoeK/dWk0Htik3J/w@public.gmane.org \
--cc=mingo-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=paulmck-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=peterz-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
--cc=rburny-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
--cc=rostedt-nx8X9YLhiw1AfugRpC6u6w@public.gmane.org \
--cc=tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org \
--cc=tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=will-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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