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
This commit is contained in:
Konstantin Belousov 2020-10-08 22:34:34 +00:00
parent 4ea4966009
commit 203dda8a63

View file

@ -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);