From nobody@FreeBSD.org  Tue Aug  1 01:16:05 2006
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id C9F1616A4DA
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  1 Aug 2006 01:16:05 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 8C14443D45
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  1 Aug 2006 01:16:05 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k711G5fj033400
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 1 Aug 2006 01:16:05 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id k711G5QU033399;
	Tue, 1 Aug 2006 01:16:05 GMT
	(envelope-from nobody)
Message-Id: <200608010116.k711G5QU033399@www.freebsd.org>
Date: Tue, 1 Aug 2006 01:16:05 GMT
From: Evgeny Larionov <AloneLion@mail.ru>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Incorrect cpu idle and usage statistics in top and systat programs in SMP 6.1-STABLE/amd64
X-Send-Pr-Version: www-2.3

>Number:         101132
>Category:       amd64
>Synopsis:       [smp] Incorrect cpu idle and usage statistics in top and systat programs in SMP 6.1-STABLE/amd64
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    gavin
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Aug 01 01:20:14 GMT 2006
>Closed-Date:    Mon Feb 04 18:57:35 UTC 2008
>Last-Modified:  Mon Feb 04 18:57:35 UTC 2008
>Originator:     Evgeny Larionov
>Release:        6.1-STABLE
>Organization:
Comlink
>Environment:
FreeBSD test.comlink.khakassia.ru 6.1-STABLE FreeBSD 6.1-STABLE #1: Sat Jul 29 19:18:29 KRAST 2006     lion@test.comlink.khakassia.ru:/usr/obj/usr/src/sys/HOSTING  amd64
>Description:
systat -v and top show incorrect information in SMP 6.1-STABLE under amd64.
When run two program with 100% cpu alocation (using only calculation without idle) on processor with HTT (2 logical processors) top and systat show only not more 50% cpu usage with 50% idle. 

top:
last pid: 52141;  load averages:  1.92,  0.95,  0.40         up 2+14:13:23  09:00:47
71 processes:  3 running, 68 sleeping
CPU states: 46.4% user,  0.0% nice,  0.0% system,  3.6% interrupt, 50.0% idle
Mem: 101M Active, 205M Inact, 106M Wired, 15M Cache, 59M Buf, 2796K Free
Swap: 1500M Total, 204K Used, 1500M Free

  PID USERNAME     THR PRI NICE   SIZE    RES STATE  C   TIME   WCPU COMMAND
52122 root           1 113    0  2412K   644K RUN    0   1:47 49.07% horse
52124 root           1 112    0  2412K   644K RUN    0   1:34 48.88% horse

systat -v:

 0.1%Sys   0.0%Intr 49.9%User  0.0%Nice 50.0%Idl   210568 inact     1 19: uhc
|    |    |    |    |    |    |    |    |    |      15856 cache     1 27: em0
>How-To-Repeat:
show top or systat -v utilities in FreeBSD 6.1-STABLE amd64 with SMP kernel during high cpu load (two or more runnig programms using only calculation without idle, looped C code for example) and you can see always 50% CPU usage, not more.
>Fix:

>Release-Note:
>Audit-Trail:

From: John Baldwin <jhb@freebsd.org>
To: freebsd-amd64@freebsd.org
Cc: Evgeny Larionov <AloneLion@mail.ru>, freebsd-gnats-submit@freebsd.org
Subject: Re: amd64/101132: Incorrect cpu idle and usage statistics in top and systat programs in SMP 6.1-STABLE/amd64
Date: Tue, 1 Aug 2006 13:18:56 -0400

 not more 50% cpu usage with 50% idle. 
 
 Try enabling hyperthreading via machdep.hyperthreading_allowed=1.
 
 -- 
 John Baldwin
State-Changed-From-To: open->feedback 
State-Changed-By: linimon 
State-Changed-When: Sat May 26 06:50:10 UTC 2007 
State-Changed-Why:  
Note that submitter was asked for feedback. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=101132 
State-Changed-From-To: feedback->closed 
State-Changed-By: gavin 
State-Changed-When: Mon Feb 4 18:56:45 UTC 2008 
State-Changed-Why:  
Feedback timeout (18 months).  To submitter: If this is still a problem, 
we can re-open the PR. 


Responsible-Changed-From-To: freebsd-amd64->gavin 
Responsible-Changed-By: gavin 
Responsible-Changed-When: Mon Feb 4 18:56:45 UTC 2008 
Responsible-Changed-Why:  
Track 

http://www.freebsd.org/cgi/query-pr.cgi?pr=101132 
>Unformatted:
