From owner-p4-projects@FreeBSD.ORG Thu Oct 28 16:03:55 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9EA4C16A509; Thu, 28 Oct 2004 16:03:54 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 59DF216A509 for ; Thu, 28 Oct 2004 16:03:54 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4C82B43D41 for ; Thu, 28 Oct 2004 16:03:54 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id i9SG3scU085509 for ; Thu, 28 Oct 2004 16:03:54 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i9SG3rti085506 for perforce@freebsd.org; Thu, 28 Oct 2004 16:03:53 GMT (envelope-from jhb@freebsd.org) Date: Thu, 28 Oct 2004 16:03:53 GMT Message-Id: <200410281603.i9SG3rti085506@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Subject: PERFORCE change 63886 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Oct 2004 16:03:55 -0000 http://perforce.freebsd.org/chv.cgi?CH=63886 Change 63886 by jhb@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); }