From nobody Sat Jan 06 12:02:26 2024 X-Original-To: freebsd-stable@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T6f8m08kkz56841 for ; Sat, 6 Jan 2024 12:02:48 +0000 (UTC) (envelope-from hausen@punkt.de) Received: from mail.punkt.de (mail.punkt.de [217.29.41.227]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4T6f8l18BFz46lV for ; Sat, 6 Jan 2024 12:02:47 +0000 (UTC) (envelope-from hausen@punkt.de) Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of hausen@punkt.de designates 217.29.41.227 as permitted sender) smtp.mailfrom=hausen@punkt.de Received: from smtpclient.apple (unknown [IPv6:2003:a:d59:3800:d560:1b09:a6af:fc15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.punkt.de (Postfix) with ESMTPSA id 76B2A6F768; Sat, 6 Jan 2024 13:02:37 +0100 (CET) Content-Type: text/plain; charset=utf-8 List-Id: Production branch of FreeBSD source code List-Archive: https://lists.freebsd.org/archives/freebsd-stable List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-stable@freebsd.org X-BeenThere: freebsd-stable@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.300.61.1.2\)) Subject: Re: Odd values for various memory metrics via SNMP From: "Patrick M. Hausen" In-Reply-To: <25996.34932.339497.605798@hergotha.csail.mit.edu> Date: Sat, 6 Jan 2024 13:02:26 +0100 Cc: FreeBSD-STABLE Mailing List Content-Transfer-Encoding: quoted-printable Message-Id: References: <1EDAF2AC-3A2B-43BE-B66B-E095F5A80C2C@punkt.de> <84B7C7D7-BC06-4944-A7E0-5AFC47B6BC0E@punkt.de> <8f4cf72e-8320-4bfd-a4d9-3db34db4580d@aetern.org> <25996.34932.339497.605798@hergotha.csail.mit.edu> To: Garrett Wollman X-Mailer: Apple Mail (2.3774.300.61.1.2) X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.77 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-0.99)[-0.992]; NEURAL_HAM_SHORT(-0.98)[-0.982]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip4:217.29.32.0/20]; MIME_GOOD(-0.10)[text/plain]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; RCVD_COUNT_ONE(0.00)[1]; ASN(0.00)[asn:16188, ipnet:217.29.32.0/20, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; R_DKIM_NA(0.00)[]; MLMMJ_DEST(0.00)[freebsd-stable@freebsd.org]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DMARC_NA(0.00)[punkt.de]; TO_DN_ALL(0.00)[]; RCVD_TLS_ALL(0.00)[] X-Rspamd-Queue-Id: 4T6f8l18BFz46lV Hi all, > Am 27.12.2023 um 21:26 schrieb Garrett Wollman = : >=20 > < said: >=20 >> Now only "virtual memory" is left - according to the book that should = be >> the sum of physical memory and swap space - and for my single Linux >> host it is. >=20 >> For the FreeBSD systems this is the one left that still looks = nonsensical. >=20 >> OPNsense (8G RAM, 8G swap): 4.91 of 4.99G used. >> TrueNAS (64G RAM, 32G swap): 627 of 628G used. >> TrueNAS 2 (32G RAM, 32G swap): 512 of 516G used. >=20 > This is computed by the function vmtotal() in sys/vm/vm_meter.c. It > walks all VM objects in the system, skipping those that are > unreferenced, and adds up all of their sizes. There is one VM object > for every open file and every running executable, shared library, and > mmap()ed region, plus one for every copy-on-write mapping for each > process that has modified it, which includes the data segment of every > executable and shared library. This has no connection to either > physical memory or swap space. Why does FreeBSD calculate the values this way while MWL's book clearly states differently? Who's wrong here? Browsing the host resources MIB I can only find the syntactical = definition of the hrStorage subtree but nowhere was I able to find a definitive = documentation on the semantics what certain entries like "virtual memory" are supposed = to mean? I'll go ask MWL where he got what he wrote in his book, but I'm still = confused. There must be some standard for meaningful values, right? Kind regards, Patrick --=20 punkt.de GmbH Patrick M. Hausen .infrastructure Sophienstr. 187 76185 Karlsruhe Tel. +49 721 9109500 https://infrastructure.punkt.de info@punkt.de AG Mannheim 108285 Gesch=C3=A4ftsf=C3=BChrer: Daniel Lienert, Fabian Stein