Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Feb 2011 07:23:29 GMT
From:      KOIE Hidetaka <koie@suri.co.jp>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/154480: gmond reports wrong number of running processes.
Message-ID:  <201102030723.p137NTYf000955@red.freebsd.org>
Resent-Message-ID: <201102030730.p137UBUx089243@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         154480
>Category:       ports
>Synopsis:       gmond reports wrong number of running processes.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Feb 03 07:30:11 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     KOIE Hidetaka
>Release:        Current
>Organization:
surigiken
>Environment:
FreeBSD guriandgura 9.0-CURRENT FreeBSD 9.0-CURRENT #0 r216681+5c4bd1174659,ver-hg,nice-powerd: Fri Dec 24 11:46:20 JST 2010     koie@guriandgura:/usr/obj/usr/src/sys/GURIANDGURA  amd64
>Description:
gmond is in sysutils/ganglia-monitor-core.
gmond resports reports running processes >= CPU even if system is idle.
for example, on 4 CPU machine, gmond reports 4 processes are running at least.
>How-To-Repeat:

>Fix:
when counting, idle threads running on each CPU must be skipped.
I don't know SWI (software interrupt) thread should be skipped.


Patch attached with submission follows:

--- libmetrics/freebsd/metrics.c-base	2011-02-03 15:32:37.931606016 +0900
+++ libmetrics/freebsd/metrics.c	2011-02-03 15:37:31.347603233 +0900
@@ -541,6 +541,16 @@ proc_run_func( void )
       goto output;
 
    for (i = 0; i < nentries; kp++, i++) {
+#if 1 /*KOIE1*/
+      /* This is a per-CPU idle thread. */ /* idle thread */
+      if ((kp->ki_tdflags & TDF_IDLETD) != 0)
+         continue;
+#endif
+#if 1 /*KOIE2*/
+      /* Ignore during load avg calculations. */ /* swi or idle thead */
+      if ((kp->ki_tdflags & TDF_NOLOAD) != 0)
+         continue;
+#endif
 #ifdef KINFO_PROC_SIZE
       state = kp->ki_stat;
 #else


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201102030723.p137NTYf000955>