From owner-svn-src-all@freebsd.org Sat Mar 23 19:53:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 677BE155B642; Sat, 23 Mar 2019 19:53:16 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0671181198; Sat, 23 Mar 2019 19:53:16 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D28CAD445; Sat, 23 Mar 2019 19:53:15 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2NJrFxA088948; Sat, 23 Mar 2019 19:53:15 GMT (envelope-from rpokala@FreeBSD.org) Received: (from rpokala@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2NJrFNc088946; Sat, 23 Mar 2019 19:53:15 GMT (envelope-from rpokala@FreeBSD.org) Message-Id: <201903231953.x2NJrFNc088946@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rpokala set sender to rpokala@FreeBSD.org using -f From: Ravi Pokala Date: Sat, 23 Mar 2019 19:53:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345457 - in head: lib/libc/gen sys/kern X-SVN-Group: head X-SVN-Commit-Author: rpokala X-SVN-Commit-Paths: in head: lib/libc/gen sys/kern X-SVN-Commit-Revision: 345457 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0671181198 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Mar 2019 19:53:16 -0000 Author: rpokala Date: Sat Mar 23 19:53:15 2019 New Revision: 345457 URL: https://svnweb.freebsd.org/changeset/base/345457 Log: Add descriptions for sysctls in kern_mib.c and sysctl.3 which lack them. r343532 noted the difference between "hw.realmem" and "hw.physmem", which I was previously unaware of. I discovered that neither sysctl had a description visible via `sysctl -d', so I found where they were defined and added suitable descriptions. While in the file, I went ahead and added descriptions for all the others which lacked them. I also updated sysctl.3 accordingly Reviewed by: kib, bcr MFC after: 1 weeks Sponsored by: Panasas Differential Revision: https://reviews.freebsd.org/D19007 Modified: head/lib/libc/gen/sysctl.3 head/sys/kern/kern_mib.c Modified: head/lib/libc/gen/sysctl.3 ============================================================================== --- head/lib/libc/gen/sysctl.3 Sat Mar 23 18:32:28 2019 (r345456) +++ head/lib/libc/gen/sysctl.3 Sat Mar 23 19:53:15 2019 (r345457) @@ -28,7 +28,7 @@ .\" @(#)sysctl.3 8.4 (Berkeley) 5/9/95 .\" $FreeBSD$ .\" -.Dd October 22, 2017 +.Dd March 22, 2019 .Dt SYSCTL 3 .Os .Sh NAME @@ -284,6 +284,7 @@ privilege may change the value. .It Dv HW_FLOATINGPT Ta integer Ta no .It Dv HW_MACHINE_ARCH Ta string Ta no .It Dv HW_REALMEM Ta integer Ta no +.It Dv HW_AVAILPAGES Ta integer Ta no .El .Bl -tag -width 6n .It Li HW_MACHINE @@ -295,9 +296,10 @@ The number of cpus. .It Li HW_BYTEORDER The byteorder (4321 or 1234). .It Li HW_PHYSMEM -The bytes of physical memory. +Amount of physical memory (in bytes), minus the amount used by the kernel, +pre-loaded modules, and (on x86) the dcons buffer. .It Li HW_USERMEM -The bytes of non-kernel memory. +Amount of memory (in bytes) which is not wired. .It Li HW_PAGESIZE The software page size. .\".It Fa HW_DISKNAMES @@ -307,7 +309,13 @@ Nonzero if the floating point support is in hardware. .It Li HW_MACHINE_ARCH The machine dependent architecture type. .It Li HW_REALMEM -The bytes of real memory. +Amount of memory (in bytes) reported by the firmware. +That value is sometimes not sane; in that case, the kernel reports the max +memory address instead. +.It Li HW_AVAILPAGES +The same value as +.Li HW_PHYSMEM , +measured in pages rather than bytes. .El .Ss CTL_KERN The string and integer information available for the CTL_KERN level Modified: head/sys/kern/kern_mib.c ============================================================================== --- head/sys/kern/kern_mib.c Sat Mar 23 18:32:28 2019 (r345456) +++ head/sys/kern/kern_mib.c Sat Mar 23 19:53:15 2019 (r345457) @@ -187,7 +187,8 @@ sysctl_hw_physmem(SYSCTL_HANDLER_ARGS) return (sysctl_handle_long(oidp, &val, 0, req)); } SYSCTL_PROC(_hw, HW_PHYSMEM, physmem, CTLTYPE_ULONG | CTLFLAG_RD, - 0, 0, sysctl_hw_physmem, "LU", ""); + 0, 0, sysctl_hw_physmem, "LU", + "Amount of physical memory (in bytes)"); static int sysctl_hw_realmem(SYSCTL_HANDLER_ARGS) @@ -201,7 +202,8 @@ sysctl_hw_realmem(SYSCTL_HANDLER_ARGS) return (sysctl_handle_long(oidp, &val, 0, req)); } SYSCTL_PROC(_hw, HW_REALMEM, realmem, CTLTYPE_ULONG | CTLFLAG_RD, - 0, 0, sysctl_hw_realmem, "LU", ""); + 0, 0, sysctl_hw_realmem, "LU", + "Amount of memory (in bytes) reported by the firmware"); static int sysctl_hw_usermem(SYSCTL_HANDLER_ARGS) @@ -216,9 +218,11 @@ sysctl_hw_usermem(SYSCTL_HANDLER_ARGS) return (sysctl_handle_long(oidp, &val, 0, req)); } SYSCTL_PROC(_hw, HW_USERMEM, usermem, CTLTYPE_ULONG | CTLFLAG_RD, - 0, 0, sysctl_hw_usermem, "LU", ""); + 0, 0, sysctl_hw_usermem, "LU", + "Amount of memory (in bytes) which is not wired"); -SYSCTL_LONG(_hw, OID_AUTO, availpages, CTLFLAG_RD, &physmem, 0, ""); +SYSCTL_LONG(_hw, OID_AUTO, availpages, CTLFLAG_RD, &physmem, 0, + "Amount of physical memory (in pages)"); u_long pagesizes[MAXPAGESIZES] = { PAGE_SIZE };