3 Jun 2012 14:58
Unit confusion in kinfo_proc2
Martin Husemann <martin <at> duskware.de>
2012-06-03 12:58:15 GMT
2012-06-03 12:58:15 GMT
It seems there is confusion wether a vmpsace vm_map.size element is
measured in bytes or pages. The uvm code seems to treat it as bytes,
so I guess we should apply something like this patch?
Note the correct usage a few lines below the patched one...
Martin
Index: kern_proc.c
===================================================================
RCS file: /cvsroot/src/sys/kern/kern_proc.c,v
retrieving revision 1.183
diff -u -1 -0 -r1.183 kern_proc.c
--- kern_proc.c 13 Apr 2012 15:32:15 -0000 1.183
+++ kern_proc.c 3 Jun 2012 12:54:41 -0000
<at> <at> -2272,21 +2272,21 <at> <at>
ki->p_nlwps = p->p_nlwps;
ki->p_realflag = ki->p_flag;
if (p->p_stat != SIDL && !P_ZOMBIE(p) && !zombie) {
vm = p->p_vmspace;
ki->p_vm_rssize = vm_resident_count(vm);
ki->p_vm_tsize = vm->vm_tsize;
ki->p_vm_dsize = vm->vm_dsize;
ki->p_vm_ssize = vm->vm_ssize;
- ki->p_vm_vsize = vm->vm_map.size;
+ ki->p_vm_vsize = atop(vm->vm_map.size);
/*
* Since the stack is initially mapped mostly with
(Continue reading)
RSS Feed