From: tip-bot for Byungchul Park <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
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
Subject: [tip:locking/core] locking/lockdep: Add a comment about crossrelease_hist_end() in lockdep_sys_exit()
Date: Mon, 14 Aug 2017 04:45:40 -0700 [thread overview]
Message-ID: <tip-a10b5c564741cd3b6708f085a1fa892b63c2063d@git.kernel.org> (raw)
In-Reply-To: <1502694052-16085-2-git-send-email-byungchul.park@lge.com>
Commit-ID: a10b5c564741cd3b6708f085a1fa892b63c2063d
Gitweb: http://git.kernel.org/tip/a10b5c564741cd3b6708f085a1fa892b63c2063d
Author: Byungchul Park <byungchul.park@lge.com>
AuthorDate: Mon, 14 Aug 2017 16:00:51 +0900
Committer: Ingo Molnar <mingo@kernel.org>
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 <byungchul.park@lge.com>
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: 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 <mingo@kernel.org>
---
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);
next prev parent reply other threads:[~2017-08-14 11:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-14 7:00 [PATCH 0/2] Fix a bug in crossrelease Byungchul Park
2017-08-14 7:00 ` [PATCH 1/2] lockdep: Add a comment about crossrelease_hist_end() in lockdep_sys_exit() Byungchul Park
2017-08-14 11:45 ` tip-bot for Byungchul Park [this message]
2017-08-14 7:00 ` [PATCH 2/2] lockdep: Fix the rollback and overwrite detection in crossrelease Byungchul Park
2017-08-14 11:46 ` [tip:locking/core] locking/lockdep: Fix the rollback and overwrite detection logic " tip-bot for Byungchul Park
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-a10b5c564741cd3b6708f085a1fa892b63c2063d@git.kernel.org \
--to=tipbot@zytor.com \
--cc=byungchul.park@lge.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome