From: claudio Date: Wed, 10 Jul 2024 12:28:46 +0000 (+0000) Subject: Kill the runfast and run label and inline those bits. No functional change. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=49d7ba99a928132210b97b2a5438468e49f421fc;p=openbsd Kill the runfast and run label and inline those bits. No functional change. OK mpi@ --- diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 8d2537ec55e..d4a5bd8b022 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sig.c,v 1.331 2024/07/09 09:22:50 claudio Exp $ */ +/* $OpenBSD: kern_sig.c,v 1.332 2024/07/10 12:28:46 claudio Exp $ */ /* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */ /* @@ -1078,7 +1078,12 @@ ptsignal(struct proc *p, int signum, enum signal_type type) */ if (signum == SIGKILL) { atomic_clearbits_int(&p->p_flag, P_SUSPSIG); - goto runfast; + /* Raise priority to at least PUSER. */ + if (p->p_usrpri > PUSER) + p->p_usrpri = PUSER; + unsleep(p); + setrunnable(p); + goto out; } if (prop & SA_CONT) { @@ -1097,10 +1102,19 @@ ptsignal(struct proc *p, int signum, enum signal_type type) wakeparent = 1; if (action == SIG_DFL) mask = 0; - if (action == SIG_CATCH) - goto runfast; - if (p->p_wchan == NULL) - goto run; + if (action == SIG_CATCH) { + /* Raise priority to at least PUSER. */ + if (p->p_usrpri > PUSER) + p->p_usrpri = PUSER; + unsleep(p); + setrunnable(p); + goto out; + } + if (p->p_wchan == NULL) { + unsleep(p); + setrunnable(p); + goto out; + } atomic_clearbits_int(&p->p_flag, P_WSLEEP); p->p_stat = SSLEEP; goto out; @@ -1146,8 +1160,11 @@ ptsignal(struct proc *p, int signum, enum signal_type type) * so it can discover the signal in cursig() and stop * for the parent. */ - if (pr->ps_flags & PS_TRACED) - goto run; + if (pr->ps_flags & PS_TRACED) { + unsleep(p); + setrunnable(p); + goto out; + } /* * Recheck sigmask before waking up the process, @@ -1206,8 +1223,13 @@ ptsignal(struct proc *p, int signum, enum signal_type type) /* * All other (caught or default) signals * cause the process to run. + * Raise priority to at least PUSER. */ - goto runfast; + if (p->p_usrpri > PUSER) + p->p_usrpri = PUSER; + unsleep(p); + setrunnable(p); + goto out; /* NOTREACHED */ case SONPROC: @@ -1229,15 +1251,6 @@ ptsignal(struct proc *p, int signum, enum signal_type type) } /* NOTREACHED */ -runfast: - /* - * Raise priority to at least PUSER. - */ - if (p->p_usrpri > PUSER) - p->p_usrpri = PUSER; -run: - unsleep(p); - setrunnable(p); out: /* finally adjust siglist */ if (mask)