Skip to content

Commit a10b5c5

Browse files
lgebyungchulparkIngo Molnar
authored andcommitted
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 <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] [ Improved the description and the comments. ] Signed-off-by: Ingo Molnar <[email protected]>
1 parent ccde85b commit a10b5c5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

kernel/locking/lockdep.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4623,6 +4623,10 @@ asmlinkage __visible void lockdep_sys_exit(void)
46234623
/*
46244624
* The lock history for each syscall should be independent. So wipe the
46254625
* 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.
46264630
*/
46274631
crossrelease_hist_end(XHLOCK_PROC);
46284632
crossrelease_hist_start(XHLOCK_PROC);

0 commit comments

Comments
 (0)