Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Mar 2023 17:48:31 GMT
From:      Dmitry Chagin <dchagin@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 413a08a9b668 - releng/13.2 - linprocfs(4): Fixup process size in the /proc/pid/stat file
Message-ID:  <202303021748.322HmVBP084944@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch releng/13.2 has been updated by dchagin:

URL: https://cgit.FreeBSD.org/src/commit/?id=413a08a9b66871fe599310e358555edf54dd61a8

commit 413a08a9b66871fe599310e358555edf54dd61a8
Author:     Dmitry Chagin <dchagin@FreeBSD.org>
AuthorDate: 2023-02-26 13:42:22 +0000
Commit:     Dmitry Chagin <dchagin@FreeBSD.org>
CommitDate: 2023-03-02 17:47:36 +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.
    
    Approved by:    re (delphij)
    PR:             265937
    Reported by:    Ray Bellis
    MFC after:      3 days
    
    (cherry picked from commit a55b5a9aed3981fcec205e246436991d138c78a2)
    (cherry picked from commit 867e8404efed7a33553646b89588831db1a2102b)
---
 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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202303021748.322HmVBP084944>