Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753267AbdHJMWr (ORCPT ); Thu, 10 Aug 2017 08:22:47 -0400 Received: from terminus.zytor.com ([65.50.211.136]:51693 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752428AbdHJMWo (ORCPT ); Thu, 10 Aug 2017 08:22:44 -0400 Date: Thu, 10 Aug 2017 05:19:12 -0700 From: tip-bot for Byungchul Park Message-ID: Cc: hpa@zytor.com, mingo@kernel.org, tglx@linutronix.de, torvalds@linux-foundation.org, byungchul.park@lge.com, linux-kernel@vger.kernel.org, peterz@infradead.org Reply-To: torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, peterz@infradead.org, byungchul.park@lge.com, tglx@linutronix.de, mingo@kernel.org, hpa@zytor.com In-Reply-To: <1502089981-21272-4-git-send-email-byungchul.park@lge.com> References: <1502089981-21272-4-git-send-email-byungchul.park@lge.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:locking/core] locking/lockdep: Change the meaning of check_prev_add()'s return value Git-Commit-ID: 70911fdc9576f4eeb3986689a1c9a778a4a4aacb X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2042 Lines: 61 Commit-ID: 70911fdc9576f4eeb3986689a1c9a778a4a4aacb Gitweb: http://git.kernel.org/tip/70911fdc9576f4eeb3986689a1c9a778a4a4aacb Author: Byungchul Park AuthorDate: Mon, 7 Aug 2017 16:12:50 +0900 Committer: Ingo Molnar CommitDate: Thu, 10 Aug 2017 12:29:06 +0200 locking/lockdep: Change the meaning of check_prev_add()'s return value 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 Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: akpm@linux-foundation.org Cc: boqun.feng@gmail.com Cc: kernel-team@lge.com Cc: kirill@shutemov.name Cc: npiggin@gmail.com Cc: walken@google.com Cc: willy@infradead.org Link: http://lkml.kernel.org/r/1502089981-21272-4-git-send-email-byungchul.park@lge.com Signed-off-by: Ingo Molnar --- 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 bdf6b31..7cf02fa 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c @@ -1881,7 +1881,7 @@ check_prev_add(struct task_struct *curr, struct held_lock *prev, if (entry->class == hlock_class(next)) { if (distance == 1) entry->distance = 1; - return 2; + return 1; } } @@ -1935,9 +1935,10 @@ check_prev_add(struct task_struct *curr, struct held_lock *prev, print_lock_name(hlock_class(next)); printk(KERN_CONT "\n"); dump_stack(); - return graph_lock(); + if (!graph_lock()) + return 0; } - return 1; + return 2; } /*