From b106d2f56a4b4461d660f74f282b8b73fe9b71dc Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Thu, 11 Apr 2002 21:03:35 +0000 Subject: [PATCH] - Set the base priority of an ithread that has no handlers when we set its normal priority. - Lock sched_lock while we dink with the priorities. - Remove a few extra blank lines. --- sys/kern/kern_intr.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/kern/kern_intr.c b/sys/kern/kern_intr.c index dce8a47f0e0..a7c3bd1d4f7 100644 --- a/sys/kern/kern_intr.c +++ b/sys/kern/kern_intr.c @@ -131,14 +131,18 @@ ithread_update(struct ithd *ithd) strncpy(p->p_comm, ithd->it_name, sizeof(ithd->it_name)); ih = TAILQ_FIRST(&ithd->it_handlers); if (ih == NULL) { + mtx_lock_spin(&sched_lock); td->td_priority = PRI_MAX_ITHD; + td->td_base_pri = PRI_MAX_ITHD; + mtx_unlock_spin(&sched_lock); ithd->it_flags &= ~IT_ENTROPY; return; } - entropy = 0; + mtx_lock_spin(&sched_lock); td->td_priority = ih->ih_pri; td->td_base_pri = ih->ih_pri; + mtx_unlock_spin(&sched_lock); TAILQ_FOREACH(ih, &ithd->it_handlers, ih_next) { if (strlen(p->p_comm) + strlen(ih->ih_name) + 1 < sizeof(p->p_comm)) { @@ -154,12 +158,10 @@ ithread_update(struct ithd *ithd) if (ih->ih_flags & IH_ENTROPY) entropy++; } - if (entropy) ithd->it_flags |= IT_ENTROPY; else ithd->it_flags &= ~IT_ENTROPY; - CTR2(KTR_INTR, "%s: updated %s\n", __func__, p->p_comm); }