summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2015-06-05 08:26:38 +0000
committerkib <kib@FreeBSD.org>2015-06-05 08:26:38 +0000
commit0a8cb339c3fc968720a3a61ef4613d05badcabb9 (patch)
tree612c64c9468e9ecdcd94baf96d1e2aa8f650ff97
parentc5849be284e9318aa6ee606e73c15787f4f39329 (diff)
downloadFreeBSD-src-0a8cb339c3fc968720a3a61ef4613d05badcabb9.zip
FreeBSD-src-0a8cb339c3fc968720a3a61ef4613d05badcabb9.tar.gz
MFC r283745:
Do not raise priority of the idle thread on singal delivery.
-rw-r--r--sys/kern/kern_sig.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
index 4ada0e4..6035045 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -2371,9 +2371,12 @@ tdsigwakeup(struct thread *td, int sig, sig_t action, int intrval)
thread_lock(td);
/*
* Bring the priority of a thread up if we want it to get
- * killed in this lifetime.
+ * killed in this lifetime. Be careful to avoid bumping the
+ * priority of the idle thread, since we still allow to signal
+ * kernel processes.
*/
- if (action == SIG_DFL && (prop & SA_KILL) && td->td_priority > PUSER)
+ if (action == SIG_DFL && (prop & SA_KILL) != 0 &&
+ td->td_priority > PUSER && !TD_IS_IDLETHREAD(td))
sched_prio(td, PUSER);
if (TD_ON_SLEEPQ(td)) {
/*
@@ -2411,7 +2414,7 @@ tdsigwakeup(struct thread *td, int sig, sig_t action, int intrval)
/*
* Give low priority threads a better chance to run.
*/
- if (td->td_priority > PUSER)
+ if (td->td_priority > PUSER && !TD_IS_IDLETHREAD(td))
sched_prio(td, PUSER);
wakeup_swapper = sleepq_abort(td, intrval);
OpenPOWER on IntegriCloud