From nobody@FreeBSD.org  Thu Feb 16 17:59:28 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B5E9B1065670
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 16 Feb 2012 17:59:28 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 9FEFA8FC0A
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 16 Feb 2012 17:59:28 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q1GHxSWn031294
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 16 Feb 2012 17:59:28 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q1GHxSx3031293;
	Thu, 16 Feb 2012 17:59:28 GMT
	(envelope-from nobody)
Message-Id: <201202161759.q1GHxSx3031293@red.freebsd.org>
Date: Thu, 16 Feb 2012 17:59:28 GMT
From: Arnaud Lacombe <lacombar@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Incorrect unit/description in `vm.vmtotal' output
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         165208
>Category:       misc
>Synopsis:       Incorrect unit/description in `vm.vmtotal' output
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    eadler
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Feb 16 18:00:24 UTC 2012
>Closed-Date:    Wed May 16 22:41:26 UTC 2012
>Last-Modified:  Wed May 16 22:41:26 UTC 2012
>Originator:     Arnaud Lacombe
>Release:        8-STABLE
>Organization:
n/a
>Environment:
% uname -a
FreeBSD shai 8.2-STABLE FreeBSD 8.2-STABLE #2: Mon May  9 14:29:02 EDT 2011
>Description:
The description "Free Memory Pages" from the output of `vm.vmtotal' is clearly wrong:

% sysctl vm.vmtotal
vm.vmtotal: 
System wide totals computed every five seconds: (values in kilobytes)
===============================================
Processes:              (RUNQ: 1 Disk Wait: 0 Page Wait: 0 Sleep: 147)
Virtual Memory:         (Total: 1075965600K, Active 2091112K)
Real Memory:            (Total: 199976K Active 122716K)
Shared Virtual Memory:  (Total: 63564K Active: 28088K)
Shared Real Memory:     (Total: 15200K Active: 11620K)
Free Memory Pages:      507564K

While the machine only really has 4G of memory, that's only at most 1 million pages. There is absolutely *no way* for this machine to have 519745536 free memory pages.
>How-To-Repeat:
run `sysctl vm.vmtotal', read output, think about what is written.
>Fix:
s/ Pages//.

and break the ABI for all the people parsing sysctl(8) output.

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->eadler 
Responsible-Changed-By: eadler 
Responsible-Changed-When: Thu Feb 16 20:02:54 UTC 2012 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=165208 
State-Changed-From-To: open->analyzed 
State-Changed-By: eadler 
State-Changed-When: Tue Mar 27 01:31:17 UTC 2012 
State-Changed-Why:  
awaiting approval 

http://www.freebsd.org/cgi/query-pr.cgi?pr=165208 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: misc/165208: commit references a PR
Date: Wed, 11 Apr 2012 14:18:34 +0000 (UTC)

 Author: eadler
 Date: Wed Apr 11 14:18:18 2012
 New Revision: 234134
 URL: http://svn.freebsd.org/changeset/base/234134
 
 Log:
   s/Free Memory Pages/Free Memory/ to avoid confusion, since we're
   reporting a number of bytes rather than a number of pages
   
   PR:		misc/165208
   Submitted by:	Arnaud Lacombe <lacombar@gmail.com>
   Approved by:	cperciva
   MFC after:	3 days
 
 Modified:
   head/sbin/sysctl/sysctl.c
 
 Modified: head/sbin/sysctl/sysctl.c
 ==============================================================================
 --- head/sbin/sysctl/sysctl.c	Wed Apr 11 14:13:22 2012	(r234133)
 +++ head/sbin/sysctl/sysctl.c	Wed Apr 11 14:18:18 2012	(r234134)
 @@ -419,7 +419,7 @@ S_vmtotal(int l2, void *p)
  	    v->t_vmshr * pageKilo, v->t_avmshr * pageKilo);
  	printf("Shared Real Memory:\t(Total: %dK Active: %dK)\n",
  	    v->t_rmshr * pageKilo, v->t_armshr * pageKilo);
 -	printf("Free Memory Pages:\t%dK\n", v->t_free * pageKilo);
 +	printf("Free Memory:\t%dK\n", v->t_free * pageKilo);
  
  	return (0);
  }
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: analyzed->patched 
State-Changed-By: eadler 
State-Changed-When: Wed Apr 11 14:21:42 UTC 2012 
State-Changed-Why:  
committed in r234134 

http://www.freebsd.org/cgi/query-pr.cgi?pr=165208 
State-Changed-From-To: patched->closed 
State-Changed-By: eadler 
State-Changed-When: Wed May 16 22:41:25 UTC 2012 
State-Changed-Why:  
MFCed a long time ago 

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