Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 70911fdc authored by Byungchul Park's avatar Byungchul Park Committed by Ingo Molnar
Browse files

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: default avatarByungchul Park <byungchul.park@lge.com>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
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: default avatarIngo Molnar <mingo@kernel.org>
parent 49347a98
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -1881,7 +1881,7 @@ check_prev_add(struct task_struct *curr, struct held_lock *prev,
		if (entry->class == hlock_class(next)) {
		if (entry->class == hlock_class(next)) {
			if (distance == 1)
			if (distance == 1)
				entry->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));
		print_lock_name(hlock_class(next));
		printk(KERN_CONT "\n");
		printk(KERN_CONT "\n");
		dump_stack();
		dump_stack();
		return graph_lock();
		if (!graph_lock())
			return 0;
	}
	}
	return 1;
	return 2;
}
}


/*
/*