From: David van Moolenbroek Date: Wed, 4 Nov 2015 11:10:57 +0000 (+0000) Subject: VM: report resource usage with VM usage info X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zpipe.c?a=commitdiff_plain;h=89926a4cc3586a746814fd52d80a1e7dc60ffa53;p=minix.git VM: report resource usage with VM usage info Change-Id: I93e898343e7fb72e75ae74c650b10f2ba570d381 --- diff --git a/minix/include/minix/vm.h b/minix/include/minix/vm.h index 149efd1f0..c8af1b3f8 100644 --- a/minix/include/minix/vm.h +++ b/minix/include/minix/vm.h @@ -54,6 +54,9 @@ struct vm_usage_info { vir_bytes vui_shared; /* shared (non-COW) part of common memory */ vir_bytes vui_virtual; /* total size of virtual address space */ vir_bytes vui_mvirtual; /* idem but minus unmapped stack pages */ + uint64_t vui_maxrss; /* maximum resident set size (in KB) */ + uint64_t vui_minflt; /* minor page faults */ + uint64_t vui_majflt; /* major page faults */ }; struct vm_region_info { diff --git a/minix/servers/vm/region.c b/minix/servers/vm/region.c index fed1e97f4..e13c0afb9 100644 --- a/minix/servers/vm/region.c +++ b/minix/servers/vm/region.c @@ -1436,6 +1436,14 @@ void get_usage_info(struct vmproc *vmp, struct vm_usage_info *vui) } region_incr_iter(&v_iter); } + + /* + * Also include getrusage resource information, so that the MIB service + * need not make more than one call to VM for each process entry. + */ + vui->vui_maxrss = vmp->vm_total_max / 1024L; + vui->vui_minflt = vmp->vm_minor_page_fault; + vui->vui_majflt = vmp->vm_major_page_fault; } /*===========================================================================*