diff options
Diffstat (limited to 'sys/kern/kern_sig.c')
-rw-r--r-- | sys/kern/kern_sig.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index b30e1ed..b70da5b 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -2368,9 +2368,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)) { /* @@ -2408,7 +2411,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); @@ -3306,7 +3309,7 @@ coredump(struct thread *td) * a corefile is truncated instead of not being created, * if it is larger than the limit. */ - limit = (off_t)lim_cur(p, RLIMIT_CORE); + limit = (off_t)lim_cur(td, RLIMIT_CORE); if (limit == 0 || racct_get_available(p, RACCT_CORE) == 0) { PROC_UNLOCK(p); return (EFBIG); |