PERFORCE change 63886 for review
John Baldwin
jhb at FreeBSD.org
Thu Oct 28 09:03:55 PDT 2004
http://perforce.freebsd.org/chv.cgi?CH=63886
Change 63886 by jhb at jhb_slimer on 2004/10/28 16:03:25
- Simplify updating the IT_ENTROPY flag.
- Fix the formatting of p_comm so that all the ++'s and *'s are
added to the end after we have added as many handler names as
will fit.
Affected files ...
.. //depot/projects/smpng/sys/kern/kern_intr.c#55 edit
Differences ...
==== //depot/projects/smpng/sys/kern/kern_intr.c#55 (text+ko) ====
@@ -129,7 +129,7 @@
struct intrhand *ih;
struct thread *td;
struct proc *p;
- int entropy;
+ int missed;
mtx_assert(&ithd->it_lock, MA_OWNED);
td = ithd->it_td;
@@ -138,6 +138,7 @@
p = td->td_proc;
strlcpy(p->p_comm, ithd->it_name, sizeof(p->p_comm));
+ ithd->it_flags &= ~IT_ENTROPY;
ih = TAILQ_FIRST(&ithd->it_handlers);
if (ih == NULL) {
@@ -145,33 +146,32 @@
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);
+ missed = 0;
TAILQ_FOREACH(ih, &ithd->it_handlers, ih_next) {
if (strlen(p->p_comm) + strlen(ih->ih_name) + 1 <
sizeof(p->p_comm)) {
strcat(p->p_comm, " ");
strcat(p->p_comm, ih->ih_name);
- } else if (strlen(p->p_comm) + 1 == sizeof(p->p_comm)) {
+ } else
+ missed++;
+ if (ih->ih_flags & IH_ENTROPY)
+ ithd->it_flags |= IT_ENTROPY;
+ }
+ while (missed-- > 0) {
+ if (strlen(p->p_comm) + 1 == sizeof(p->p_comm)) {
if (p->p_comm[sizeof(p->p_comm) - 2] == '+')
p->p_comm[sizeof(p->p_comm) - 2] = '*';
else
p->p_comm[sizeof(p->p_comm) - 2] = '+';
} else
strcat(p->p_comm, "+");
- 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", __func__, p->p_comm);
}
More information about the p4-projects
mailing list