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


Groups > linux.kernel > #1710675

[PATCH 1/2] lockdep: Add a comment about crossrelease_hist_end() in lockdep_sys_exit()

From Byungchul Park <byungchul.park@lge.com>
Newsgroups linux.kernel
Subject [PATCH 1/2] lockdep: Add a comment about crossrelease_hist_end() in lockdep_sys_exit()
Date 2017-08-14 09:10 +0200
Message-ID <uehFE-14m-19@gated-at.bofh.it> (permalink)
References <uehFE-14m-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


In lockdep_sys_exit(), crossrelease_hist_end() is called unconditionally
even when getting here without having started e.g. just after forked.
But it's no problem since it anyway would rollback to an invalid element.
A comment would be helpful to understand this situation.

Signed-off-by: Byungchul Park <byungchul.park@lge.com>
---
 kernel/locking/lockdep.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index 1114dc4..1ae4258 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() would work well even when getting here
+	 * without starting just after forked, it rollbacks back the index
+	 * to point to the last which is already invalid.
 	 */
 	crossrelease_hist_end(XHLOCK_PROC);
 	crossrelease_hist_start(XHLOCK_PROC);
-- 
1.9.1

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


Thread

[PATCH 0/2] Fix a bug in crossrelease Byungchul Park <byungchul.park@lge.com> - 2017-08-14 09:10 +0200
  [PATCH 1/2] lockdep: Add a comment about crossrelease_hist_end() in lockdep_sys_exit() Byungchul Park <byungchul.park@lge.com> - 2017-08-14 09:10 +0200
    [tip:locking/core] locking/lockdep: Add a comment about  crossrelease_hist_end() in lockdep_sys_exit() tip-bot for Byungchul Park <tipbot@zytor.com> - 2017-08-14 13:50 +0200
  [PATCH 2/2] lockdep: Fix the rollback and overwrite detection in crossrelease Byungchul Park <byungchul.park@lge.com> - 2017-08-14 09:10 +0200
    [tip:locking/core] locking/lockdep: Fix the rollback and overwrite  detection logic in crossrelease tip-bot for Byungchul Park <tipbot@zytor.com> - 2017-08-14 14:00 +0200

csiph-web