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


Groups > linux.kernel > #1600105 > unrolled thread

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

Started byByungchul Park <byungchul.park@lge.com>
First post2017-03-14 09:30 +0100
Last post2017-03-14 09:30 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v6 03/15] lockdep: Change the meaning of check_prev_add()'s return value Byungchul Park <byungchul.park@lge.com> - 2017-03-14 09:30 +0100

#1600105 — [PATCH v6 03/15] lockdep: Change the meaning of check_prev_add()'s return value

FromByungchul Park <byungchul.park@lge.com>
Date2017-03-14 09:30 +0100
Subject[PATCH v6 03/15] lockdep: Change the meaning of check_prev_add()'s return value
Message-ID<tkQ09-5P9-11@gated-at.bofh.it>
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 eb39474..4709110 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -1854,7 +1854,7 @@ static inline void inc_chains(void)
 		if (entry->class == hlock_class(next)) {
 			if (distance == 1)
 				entry->distance = 1;
-			return 2;
+			return 1;
 		}
 	}
 
@@ -1894,9 +1894,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

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web