Author: kib
Date: Thu Oct  8 22:34:34 2020
New Revision: 366550
URL: https://svnweb.freebsd.org/changeset/base/366550

Log:
  sig_intr(9): return early if AST is not scheduled.
  
  Check td_flags for relevant AST requests lock-less.  This opens the
  race slightly wider where sig_intr() returns false negative, but might
  be it is worth it.
  
  Requested by: mjg
  Sponsored by: The FreeBSD Foundation
  MFC after:    1 week

Modified:
  head/sys/kern/kern_sig.c

Modified: head/sys/kern/kern_sig.c
==============================================================================
--- head/sys/kern/kern_sig.c    Thu Oct  8 22:31:11 2020        (r366549)
+++ head/sys/kern/kern_sig.c    Thu Oct  8 22:34:34 2020        (r366550)
@@ -3212,6 +3212,9 @@ sig_intr(void)
        int ret;
 
        td = curthread;
+       if ((td->td_flags & (TDF_NEEDSIGCHK | TDF_NEEDSUSPCHK)) == 0)
+               return (0);
+
        p = td->td_proc;
 
        PROC_LOCK(p);
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to