]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fixed a longstanding latency bug in signal delivery. When a signal
authorbde <bde@FreeBSD.org>
Mon, 19 Feb 2001 09:40:58 +0000 (09:40 +0000)
committerbde <bde@FreeBSD.org>
Mon, 19 Feb 2001 09:40:58 +0000 (09:40 +0000)
commit3941e240951610fbcc5ea014546b44ef58f5a653
tree1ef084ce9a834e08901e5a1c6da8a628ea189f0b
parente4a32d70409e6e91e0c40ff94ad122adcbf9cb87
Fixed a longstanding latency bug in signal delivery.  When a signal
is sent to a process, psignal() needs to schedule an AST for the
process if the process is runnable, not just if it is current, so that
pending signals get checked for on the next return of the process to
user mode.  This wasn't practical until recently because the AST flag
was per-cpu so setting it for a non-current process would usually just
cause a bogus AST for the current process.

For non-current processes looping in user mode, it took accidental
(?) magic to deliver signals at all.  Signals were usually delivered
late as a side effect of rescheduling (need_resched() sets astpending,
etc.).  In pre-SMPng, delivery was delayed by at most 1 quantum (the
need_resched() call in roundrobin() is certain to occur within 1
quantum for looping processes).  In -current, things are complicated
by normal interrupt handlers being threads.  Missing handling of the
complications makes roundrobin() a bogus no-op, but preemptive
scheduling sort of works anyway due to even larger bogons elsewhere.
sys/kern/kern_sig.c