[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-fe27b0de8dfcdf8482558ce5d25e697fe74d851e@git.kernel.org>
Date: Tue, 11 Dec 2018 07:29:40 -0800
From: tip-bot for Bart Van Assche <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: johannes@...solutions.net, sasha.levin@...cle.com,
longman@...hat.com, mingo@...nel.org, tglx@...utronix.de,
hpa@...or.com, bvanassche@....org, linux-kernel@...r.kernel.org,
peterz@...radead.org, torvalds@...ux-foundation.org
Subject: [tip:locking/core] locking/lockdep: Stop using RCU primitives to
access 'all_lock_classes'
Commit-ID: fe27b0de8dfcdf8482558ce5d25e697fe74d851e
Gitweb: https://git.kernel.org/tip/fe27b0de8dfcdf8482558ce5d25e697fe74d851e
Author: Bart Van Assche <bvanassche@....org>
AuthorDate: Thu, 6 Dec 2018 17:11:37 -0800
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Tue, 11 Dec 2018 14:54:56 +0100
locking/lockdep: Stop using RCU primitives to access 'all_lock_classes'
Due to the previous patch all code that accesses the 'all_lock_classes'
list holds the graph lock. Hence use regular list primitives instead of
their RCU variants to access this list.
Signed-off-by: Bart Van Assche <bvanassche@....org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Cc: Johannes Berg <johannes@...solutions.net>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Sasha Levin <sasha.levin@...cle.com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Waiman Long <longman@...hat.com>
Cc: johannes.berg@...el.com
Cc: tj@...nel.org
Link: https://lkml.kernel.org/r/20181207011148.251812-14-bvanassche@acm.org
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
kernel/locking/lockdep.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index 737d2dd3ea56..5c837a537273 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -629,7 +629,8 @@ static int static_obj(void *obj)
/*
* To make lock name printouts unique, we calculate a unique
- * class->name_version generation counter:
+ * class->name_version generation counter. The caller must hold the graph
+ * lock.
*/
static int count_matching_names(struct lock_class *new_class)
{
@@ -639,7 +640,7 @@ static int count_matching_names(struct lock_class *new_class)
if (!new_class->name)
return 0;
- list_for_each_entry_rcu(class, &all_lock_classes, lock_entry) {
+ list_for_each_entry(class, &all_lock_classes, lock_entry) {
if (new_class->key - new_class->subclass == class->key)
return class->name_version;
if (class->name && !strcmp(class->name, new_class->name))
@@ -803,7 +804,7 @@ register_lock_class(struct lockdep_map *lock, unsigned int subclass, int force)
/*
* Add it to the global list of classes:
*/
- list_add_tail_rcu(&class->lock_entry, &all_lock_classes);
+ list_add_tail(&class->lock_entry, &all_lock_classes);
if (verbose(class)) {
graph_unlock();
@@ -4141,7 +4142,7 @@ static void zap_class(struct lock_class *class)
* Unhash the class and remove it from the all_lock_classes list:
*/
hlist_del_rcu(&class->hash_entry);
- list_del_rcu(&class->lock_entry);
+ list_del(&class->lock_entry);
RCU_INIT_POINTER(class->key, NULL);
RCU_INIT_POINTER(class->name, NULL);
Powered by blists - more mailing lists