aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/kern_sig.c
diff options
context:
space:
mode:
authorBruce Evans <bde@FreeBSD.org>2000-09-17 15:12:04 +0000
committerBruce Evans <bde@FreeBSD.org>2000-09-17 15:12:04 +0000
commit33510ef17a968cdc3c553022e377542d5ac548a5 (patch)
tree1053ac7810bdf6380c33ffd4124290dd6e47f96e /sys/kern/kern_sig.c
parentfbbeeb6cd6b819a5fca1aeb0ba3da6438253d949 (diff)
downloadsrc-33510ef17a968cdc3c553022e377542d5ac548a5.tar.gz
src-33510ef17a968cdc3c553022e377542d5ac548a5.zip
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().
Notes
Notes: svn path=/head/; revision=65988
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 1e8561ff9dbb..b93277bdcec2 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