diff options
author | Dmitry Chagin <dchagin@FreeBSD.org> | 2023-02-26 13:42:22 +0000 |
---|---|---|
committer | Dmitry Chagin <dchagin@FreeBSD.org> | 2023-03-02 18:59:19 +0000 |
commit | 3c4af6fe955fa8427ebc1206046bdc0d35a692bb (patch) | |
tree | f7de9e6cd7bf53579b8edbac28ec7ed189651d10 | |
parent | 7e8aaae6b8adaad76605e222f2a8bd48f2ee6c8d (diff) | |
download | src-3c4af6fe955fa8427ebc1206046bdc0d35a692bb.tar.gz src-3c4af6fe955fa8427ebc1206046bdc0d35a692bb.zip |
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)
-rw-r--r-- | sys/compat/linprocfs/linprocfs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c index de65078e7ee9..e0491581b090 100644 --- a/sys/compat/linprocfs/linprocfs.c +++ b/sys/compat/linprocfs/linprocfs.c @@ -848,7 +848,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); |