summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2002-04-11 21:03:35 +0000
committerjhb <jhb@FreeBSD.org>2002-04-11 21:03:35 +0000
commit9522d33ac942ccfb84dd2da810b0b312a257de4d (patch)
tree2787151457ae05b1d9c124d93f4665d094d0ddcc /sys/kern
parent7674fba7307b26d8d92a4a0b95520cf386d02667 (diff)
downloadFreeBSD-src-9522d33ac942ccfb84dd2da810b0b312a257de4d.zip
FreeBSD-src-9522d33ac942ccfb84dd2da810b0b312a257de4d.tar.gz
- 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.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_intr.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/kern/kern_intr.c b/sys/kern/kern_intr.c
index dce8a47..a7c3bd1 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);
}
OpenPOWER on IntegriCloud