aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/kern_proc.c
diff options
context:
space:
mode:
authorMikolaj Golub <trociny@FreeBSD.org>2011-11-07 21:13:19 +0000
committerMikolaj Golub <trociny@FreeBSD.org>2011-11-07 21:13:19 +0000
commit5384d08913e8fdda97a19362322ba72e2fe15076 (patch)
treeb1fe02d331b9ad44e20ded27f675fc709ecbd18a /sys/kern/kern_proc.c
parentbde886fba4b39e1db819960f453a19586ff7486f (diff)
downloadsrc-5384d08913e8fdda97a19362322ba72e2fe15076.tar.gz
src-5384d08913e8fdda97a19362322ba72e2fe15076.zip
Notes
Diffstat (limited to 'sys/kern/kern_proc.c')
-rw-r--r--sys/kern/kern_proc.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c
index 998e7caaf650..449acc204bf4 100644
--- a/sys/kern/kern_proc.c
+++ b/sys/kern/kern_proc.c
@@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$");
#include <sys/lock.h>
#include <sys/loginclass.h>
#include <sys/malloc.h>
+#include <sys/mman.h>
#include <sys/mount.h>
#include <sys/mutex.h>
#include <sys/proc.h>
@@ -75,6 +76,7 @@ __FBSDID("$FreeBSD$");
#include <vm/pmap.h>
#include <vm/vm_map.h>
#include <vm/vm_object.h>
+#include <vm/vm_page.h>
#include <vm/uma.h>
#ifdef COMPAT_FREEBSD32
@@ -1710,7 +1712,8 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_ARGS)
entry = entry->next) {
vm_object_t obj, tobj, lobj;
vm_offset_t addr;
- int vfslocked;
+ vm_paddr_t locked_pa;
+ int vfslocked, mincoreinfo;
if (entry->eflags & MAP_ENTRY_IS_SUB_MAP)
continue;
@@ -1728,8 +1731,14 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_ARGS)
kve->kve_resident = 0;
addr = entry->start;
while (addr < entry->end) {
- if (pmap_extract(map->pmap, addr))
+ locked_pa = 0;
+ mincoreinfo = pmap_mincore(map->pmap, addr, &locked_pa);
+ if (locked_pa != 0)
+ vm_page_unlock(PHYS_TO_VM_PAGE(locked_pa));
+ if (mincoreinfo & MINCORE_INCORE)
kve->kve_resident++;
+ if (mincoreinfo & MINCORE_SUPER)
+ kve->kve_flags |= KVME_FLAG_SUPER;
addr += PAGE_SIZE;
}