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


Groups > linux.kernel > #1600105

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

Path csiph.com!news.redatomik.org!aioe.org!news.servidellagleba.it!bofh.it!news.nic.it!robomod
From Byungchul Park <byungchul.park@lge.com>
Newsgroups linux.kernel
Subject [PATCH v6 03/15] lockdep: Change the meaning of check_prev_add()'s return value
Date Tue, 14 Mar 2017 09:30:01 +0100
Message-ID <tkQ09-5P9-11@gated-at.bofh.it> (permalink)
References <tkQ09-5P9-3@gated-at.bofh.it>
X-Original-To <peterz@infradead.org>, <mingo@kernel.org>
X-Original-Senderip 156.147.1.126
X-Original-Mailfrom byungchul.park@lge.com
X-Original-Senderip 165.244.249.23
X-Original-Mailfrom byungchul.park@lge.com
X-Original-Senderip 10.177.222.33
X-Original-Mailfrom byungchul.park@lge.com
X-Mailer git-send-email 1.9.1
X-Mimetrack Itemize by SMTP Server on LGEKRMHUB03/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2017/03/14 17:19:37, Serialize by Router on LGEKRMHUB03/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2017/03/14 17:19:38, Serialize complete at 2017/03/14 17:19:38
MIME-Version 1.0
Content-Type text/plain
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 41
Organization linux.* mail to news gateway
X-Original-Cc <tglx@linutronix.de>, <walken@google.com>, <boqun.feng@gmail.com>, <kirill@shutemov.name>, <linux-kernel@vger.kernel.org>, <linux-mm@kvack.org>, <iamjoonsoo.kim@lge.com>, <akpm@linux-foundation.org>, <willy@infradead.org>, <npiggin@gmail.com>, <kernel-team@lge.com>
X-Original-Date Tue, 14 Mar 2017 17:18:50 +0900
X-Original-Message-ID <1489479542-27030-4-git-send-email-byungchul.park@lge.com>
X-Original-References <1489479542-27030-1-git-send-email-byungchul.park@lge.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1600105

Show key headers only | 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 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

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[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

csiph-web