Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1705145

[PATCH v8 03/14] lockdep: Change the meaning of check_prev_add()'s return value

From Byungchul Park <byungchul.park@lge.com>
Newsgroups linux.kernel
Subject [PATCH v8 03/14] lockdep: Change the meaning of check_prev_add()'s return value
Date 2017-08-07 09:20 +0200
Message-ID <ubKut-59V-5@gated-at.bofh.it> (permalink)
References <ubKut-59V-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Firstly, return 1 instead of 2 when 'prev -> next' dependency already
exists. Since the value 2 is not referenced anywhere, just return 1
indicating success in this case.

Secondly, return 2 instead of 1 when successfully added a lock_list
entry with saving stack_trace. With that, a caller can decide whether
to avoid redundant save_trace() on the caller site.

Signed-off-by: Byungchul Park <byungchul.park@lge.com>
---
 kernel/locking/lockdep.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index 9d16723..b23e930 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -1870,7 +1870,7 @@ static inline void inc_chains(void)
 		if (entry->class == hlock_class(next)) {
 			if (distance == 1)
 				entry->distance = 1;
-			return 2;
+			return 1;
 		}
 	}
 
@@ -1910,9 +1910,10 @@ static inline void inc_chains(void)
 		print_lock_name(hlock_class(next));
 		printk(KERN_CONT "\n");
 		dump_stack();
-		return graph_lock();
+		if (!graph_lock())
+			return 0;
 	}
-	return 1;
+	return 2;
 }
 
 /*
-- 
1.9.1

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH v8 03/14] lockdep: Change the meaning of check_prev_add()'s return value Byungchul Park <byungchul.park@lge.com> - 2017-08-07 09:20 +0200
  [tip:locking/core] locking/lockdep: Change the meaning of  check_prev_add()'s return value tip-bot for Byungchul Park <tipbot@zytor.com> - 2017-08-10 14:30 +0200

csiph-web