Skip to content

Commit

Permalink
x86/fault: Document the locking in the fault_signal_pending() path
Browse files Browse the repository at this point in the history
If fault_signal_pending() returns true, then the core mm has unlocked the
mm for us.  Add a comment to help future readers of this code.

Cc: Dave Hansen <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Signed-off-by: Andy Lutomirski <[email protected]>
  • Loading branch information
amluto authored and intel-lab-lkp committed Jan 31, 2021
1 parent f65d36c commit ca9fd73
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion arch/x86/mm/fault.c
Original file line number Diff line number Diff line change
Expand Up @@ -1343,8 +1343,11 @@ void do_user_addr_fault(struct pt_regs *regs,
*/
fault = handle_mm_fault(vma, address, flags, regs);

/* Quick path to respond to signals */
if (fault_signal_pending(fault, regs)) {
/*
* Quick path to respond to signals. The core mm code
* has unlocked the mm for us if we get here.
*/
if (!user_mode(regs))
no_context(regs, error_code, address, SIGBUS,
BUS_ADRERR);
Expand Down

0 comments on commit ca9fd73

Please sign in to comment.