diff options
| author | Byungchul Park <byungchul.park@lge.com> | 2017-08-14 03:00:51 -0400 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2017-08-14 06:52:17 -0400 |
| commit | a10b5c564741cd3b6708f085a1fa892b63c2063d (patch) | |
| tree | 40d6e4d2ee27832eefd092b5a538ec035a12df80 | |
| parent | ccde85ba00cccd28436e19c5bf503165c55a04f3 (diff) | |
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>
| -rw-r--r-- | kernel/locking/lockdep.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c index 1114dc42c27f..257931e2fbbe 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c | |||
| @@ -4623,6 +4623,10 @@ asmlinkage __visible void lockdep_sys_exit(void) | |||
| 4623 | /* | 4623 | /* |
| 4624 | * The lock history for each syscall should be independent. So wipe the | 4624 | * The lock history for each syscall should be independent. So wipe the |
| 4625 | * slate clean on return to userspace. | 4625 | * slate clean on return to userspace. |
| 4626 | * | ||
| 4627 | * crossrelease_hist_end() works well here even when getting here | ||
| 4628 | * without starting (i.e. just after forking), because it rolls back | ||
| 4629 | * the index to point to the last entry, which is already invalid. | ||
| 4626 | */ | 4630 | */ |
| 4627 | crossrelease_hist_end(XHLOCK_PROC); | 4631 | crossrelease_hist_end(XHLOCK_PROC); |
| 4628 | crossrelease_hist_start(XHLOCK_PROC); | 4632 | crossrelease_hist_start(XHLOCK_PROC); |
