From nobody Wed Mar 1 09:46:08 2023 X-Original-To: dev-commits-src-branches@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 4PRTrd06Rzz3vfdg; Wed, 1 Mar 2023 09:46:09 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PRTrc6hh3z4GtY; Wed, 1 Mar 2023 09:46:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677663968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EyWdogyp7D/hEHX2gVqf3lEPls4tgTvyv+32q8JDQZg=; b=J1zVKNooM1D8mj8GZBRLqcxtlcK9GX1MnpZq6Jx+66aZw+JOeYqoaxhd63W+RDe++PPlud yHZ04R77Sx8+T6wdFQmh9lDqG870OdwzmbbEu0vfJe7Y/C9KqNzymUnnJz74sBfA5Igrfg zxDnloJARl2RHX3FdHoXC+Oek42xvbCMKoJAcFmNSCZ32C84ScpRAVy0F4eimqt3aL0WwD GO1mp/Pc6+2RK0ldvFYinxf3nuDqZ7xvWKr2rIPIgvP/1Rpj7iaWcMHQRPTKKxxjT4XZMq F1rZztIqpHf4qbjRady4+DXlzqhl6QInem2/kvrDIIYq0LC/2oRAqQKNEn8rnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677663968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EyWdogyp7D/hEHX2gVqf3lEPls4tgTvyv+32q8JDQZg=; b=Fh9pbxeEoYnKA6GLlMTQKk2vJmz54qd7+c/z0Fqaq5065T6WoHvCgPtCqjPk3fGF8Rv1xC LvkkK/NV2OW4f5NCV7Mw3MyDYA0gmzKwD9B+v7/39W425M2w57yHVsWpFdJhlNurJvnVNQ v7/iM5mepbTOTYXlfw8PjUEsD10cviUQeGVVcyCNtHWg7rBYHxCMKhr6q6d7rqY3KJkKGR C9lROgVeWjZpUsIAQFs6Td0zI6aG9d9Gcp7Fctp7XsLATdKhfiuzpMe7oXEpsNUoNvFqAn fJuI5e66Z4uHoDNKNXMhuMzyZmCcp8IUqlvtWCoDXfbVVQdfiqVtp3sK4rWU2Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677663968; a=rsa-sha256; cv=none; b=QG49Jn1qY70jmw5/XTRaIFfF8MkUhhIeWS6c59PfimX4fKQ5wdYLtqmYlDMO/ps8WqKnac IPcTx51MbT8xwNWBIotADNeJ5bgm/m/0VSoxhHwLHJTYkvRDZqfR3jbLRCSb7NaCsyqRto aKFcJ+xmtprqazFLAPFmffPfF5nrLXEy1OYNMTbwogCmUKY12ppQV4wHg5LKu/sM5GPWYA vBgALKexoCcnT2jpv5TbcX8GaFje/eLHbrcVyQedKRZDprW9wnMbD3xqZMMcgWhYK7TkzC PA153Ft6Sb+HHVQjDrSp7P/4BzblhfP6RvETM78ZgMlJcRkbUEBEjXBG3dIKWg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PRTrc5lpJzTMR; Wed, 1 Mar 2023 09:46:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3219k82l027781; Wed, 1 Mar 2023 09:46:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3219k8FO027780; Wed, 1 Mar 2023 09:46:08 GMT (envelope-from git) Date: Wed, 1 Mar 2023 09:46:08 GMT Message-Id: <202303010946.3219k8FO027780@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 867e8404efed - stable/13 - linprocfs(4): Fixup process size in the /proc/pid/stat file List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 867e8404efed7a33553646b89588831db1a2102b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=867e8404efed7a33553646b89588831db1a2102b commit 867e8404efed7a33553646b89588831db1a2102b Author: Dmitry Chagin AuthorDate: 2023-02-26 13:42:22 +0000 Commit: Dmitry Chagin CommitDate: 2023-03-01 09:45:56 +0000 linprocfs(4): Fixup process size in the /proc/pid/stat file According to the Linux sources the kernel exposes a proces virtual memory size via proc filesystem into the three files - stat, status and statm. This is the struct mm->total_vm value adjusted to the corresponding units - bytes, kilobytes and pages. The fix is based on a fernape@ analysis. PR: 265937 Reported by: Ray Bellis MFC after: 3 days (cherry picked from commit a55b5a9aed3981fcec205e246436991d138c78a2) --- sys/compat/linprocfs/linprocfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c index 3aa01de9ce65..9166e46355ec 100644 --- a/sys/compat/linprocfs/linprocfs.c +++ b/sys/compat/linprocfs/linprocfs.c @@ -1023,7 +1023,7 @@ linprocfs_doprocstat(PFS_FILL_ARGS) PS_ADD("0", "%d", 0); /* removed field */ PS_ADD("itrealvalue", "%d", 0); /* XXX */ PS_ADD("starttime", "%lu", TV2J(&kp.ki_start) - TV2J(&boottime)); - PS_ADD("vsize", "%ju", P2K((uintmax_t)kp.ki_size)); + PS_ADD("vsize", "%ju", (uintmax_t)kp.ki_size); PS_ADD("rss", "%ju", (uintmax_t)kp.ki_rssize); PS_ADD("rlim", "%lu", kp.ki_rusage.ru_maxrss); PS_ADD("startcode", "%ju", (uintmax_t)startcode);