From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753037AbdHNLto (ORCPT ); Mon, 14 Aug 2017 07:49:44 -0400 Received: from terminus.zytor.com ([65.50.211.136]:34329 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752475AbdHNLtm (ORCPT ); Mon, 14 Aug 2017 07:49:42 -0400 Date: Mon, 14 Aug 2017 04:45:40 -0700 From: tip-bot for Byungchul Park Message-ID: Cc: byungchul.park@lge.com, hpa@zytor.com, linux-kernel@vger.kernel.org, peterz@infradead.org, mingo@kernel.org, tglx@linutronix.de, torvalds@linux-foundation.org Reply-To: byungchul.park@lge.com, hpa@zytor.com, linux-kernel@vger.kernel.org, peterz@infradead.org, mingo@kernel.org, tglx@linutronix.de, torvalds@linux-foundation.org In-Reply-To: <1502694052-16085-2-git-send-email-byungchul.park@lge.com> References: <1502694052-16085-2-git-send-email-byungchul.park@lge.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:locking/core] locking/lockdep: Add a comment about crossrelease_hist_end() in lockdep_sys_exit() Git-Commit-ID: a10b5c564741cd3b6708f085a1fa892b63c2063d 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 Commit-ID: a10b5c564741cd3b6708f085a1fa892b63c2063d Gitweb: http://git.kernel.org/tip/a10b5c564741cd3b6708f085a1fa892b63c2063d Author: Byungchul Park AuthorDate: Mon, 14 Aug 2017 16:00:51 +0900 Committer: Ingo Molnar CommitDate: Mon, 14 Aug 2017 12:52:17 +0200 locking/lockdep: Add a comment about crossrelease_hist_end() in lockdep_sys_exit() In lockdep_sys_exit(), crossrelease_hist_end() is called unconditionally even when getting here without having started e.g. just after forking. But it's no problem since it would roll back to an invalid entry anyway. Add a comment to explain this. Signed-off-by: Byungchul Park 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: linux-mm@kvack.org Cc: npiggin@gmail.com Cc: walken@google.com Cc: willy@infradead.org Link: http://lkml.kernel.org/r/1502694052-16085-2-git-send-email-byungchul.park@lge.com [ Improved the description and the comments. ] Signed-off-by: Ingo Molnar --- kernel/locking/lockdep.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c index 1114dc4..257931e 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c @@ -4623,6 +4623,10 @@ asmlinkage __visible void lockdep_sys_exit(void) /* * The lock history for each syscall should be independent. So wipe the * slate clean on return to userspace. + * + * crossrelease_hist_end() works well here even when getting here + * without starting (i.e. just after forking), because it rolls back + * the index to point to the last entry, which is already invalid. */ crossrelease_hist_end(XHLOCK_PROC); crossrelease_hist_start(XHLOCK_PROC);