Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Update our vm resource use for sysctl(3) call readi...



details:   https://anonhg.NetBSD.org/src/rev/7ca56782dc03
branches:  trunk
changeset: 458609:7ca56782dc03
user:      kamil <kamil%NetBSD.org@localhost>
date:      Fri Aug 02 22:46:44 2019 +0000

description:
Update our vm resource use for sysctl(3) call reading kinfo_proc*

Without this change RSS properties are zeroed unless a process exits or
calls getrusage(2).

diffstat:

 sys/kern/kern_proc.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (27 lines):

diff -r 20c589450beb -r 7ca56782dc03 sys/kern/kern_proc.c
--- a/sys/kern/kern_proc.c      Fri Aug 02 19:58:00 2019 +0000
+++ b/sys/kern/kern_proc.c      Fri Aug 02 22:46:44 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_proc.c,v 1.233 2019/06/11 23:18:55 kamil Exp $    */
+/*     $NetBSD: kern_proc.c,v 1.234 2019/08/02 22:46:44 kamil Exp $    */
 
 /*-
  * Copyright (c) 1999, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_proc.c,v 1.233 2019/06/11 23:18:55 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_proc.c,v 1.234 2019/08/02 22:46:44 kamil Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_kstack.h"
@@ -1819,6 +1819,8 @@
 
                if (buflen >= elem_size &&
                    (type == KERN_PROC || elem_count > 0)) {
+                       ruspace(p);     /* Update process vm resource use */
+
                        if (type == KERN_PROC) {
                                fill_proc(p, &kbuf->kproc.kp_proc, allowaddr);
                                fill_eproc(p, &kbuf->kproc.kp_eproc, zombie,



Home | Main Index | Thread Index | Old Index