lkml.org 
[lkml]   [2018]   [Nov]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC PATCH 11/12] cgroup: Mark the rstat percpu lock as terminal
Date
By classifying the cgroup rstat percpu locks as terminal locks, it
reduces the lockdep overhead when these locks are being used.

Signed-off-by: Waiman Long <longman@redhat.com>
---
kernel/cgroup/rstat.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/kernel/cgroup/rstat.c b/kernel/cgroup/rstat.c
index d503d1a..47f7ffb 100644
--- a/kernel/cgroup/rstat.c
+++ b/kernel/cgroup/rstat.c
@@ -291,8 +291,13 @@ void __init cgroup_rstat_boot(void)
{
int cpu;

- for_each_possible_cpu(cpu)
- raw_spin_lock_init(per_cpu_ptr(&cgroup_rstat_cpu_lock, cpu));
+ for_each_possible_cpu(cpu) {
+ raw_spinlock_t *cgroup_rstat_percpu_lock =
+ per_cpu_ptr(&cgroup_rstat_cpu_lock, cpu);
+
+ raw_spin_lock_init(cgroup_rstat_percpu_lock);
+ lockdep_set_terminal_class(cgroup_rstat_percpu_lock);
+ }

BUG_ON(cgroup_rstat_init(&cgrp_dfl_root.cgrp));
}
--
1.8.3.1
\
 
 \ /
  Last update: 2018-11-08 21:37    [W:0.161 / U:1.004 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site