summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_sig.c
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>2000-09-17 15:12:04 +0000
committerbde <bde@FreeBSD.org>2000-09-17 15:12:04 +0000
commit43da3c7d5337f1a4e9e85852abb81dff5ef9e733 (patch)
treecb1587b5b80256b678e180623fc9561ddb1b8b4b /sys/kern/kern_sig.c
parent80d33b22bf795a46870a6b7d65b4015725f6e860 (diff)
downloadFreeBSD-src-43da3c7d5337f1a4e9e85852abb81dff5ef9e733.zip
FreeBSD-src-43da3c7d5337f1a4e9e85852abb81dff5ef9e733.tar.gz
Unpessimized CURSIG(). The fast path through CURSIG() was broken in
the 128-bit sigset_t changes by moving conditionally (rarely) executed code to the beginning where it is always executed, and since this code now involves 3 128-bit operations, the pessimization was relatively large. This change speeds up lmbench's pipe latency benchmark by 3.5%. Fixed style bugs in CURSIG().
Diffstat (limited to 'sys/kern/kern_sig.c')
-rw-r--r--sys/kern/kern_sig.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
index 1e8561f..b93277b 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -172,7 +172,7 @@ static int sigproptbl[NSIG] = {
* process, 0 if none. If there is a pending stop signal with default
* action, the process stops in issignal().
*
- * MP SAFE
+ * MP SAFE.
*/
int
CURSIG(struct proc *p)
@@ -180,16 +180,16 @@ CURSIG(struct proc *p)
sigset_t tmpset;
int r;
+ if (SIGISEMPTY(p->p_siglist))
+ return (0);
tmpset = p->p_siglist;
SIGSETNAND(tmpset, p->p_sigmask);
- if (SIGISEMPTY(p->p_siglist) ||
- (!(p->p_flag & P_TRACED) && SIGISEMPTY(tmpset))) {
- return(0);
- }
+ if (SIGISEMPTY(tmpset) && (p->p_flag & P_TRACED) == 0)
+ return (0);
mtx_enter(&Giant, MTX_DEF);
r = issignal(p);
mtx_exit(&Giant, MTX_DEF);
- return(r);
+ return (r);
}
static __inline int
OpenPOWER on IntegriCloud