diff options
author | luoqi <luoqi@FreeBSD.org> | 1999-02-19 19:34:49 +0000 |
---|---|---|
committer | luoqi <luoqi@FreeBSD.org> | 1999-02-19 19:34:49 +0000 |
commit | bc93c63b6f8c0958e4477597f14f8897f1c8cec3 (patch) | |
tree | d108ab7d8f0fdeccb03c33073e9722969573c189 /sys/kern/kern_tc.c | |
parent | e0559c2622dd5910cbc4e00c4cf297fddf071801 (diff) | |
download | FreeBSD-src-bc93c63b6f8c0958e4477597f14f8897f1c8cec3.zip FreeBSD-src-bc93c63b6f8c0958e4477597f14f8897f1c8cec3.tar.gz |
Introduce machine-dependent macro pgtok() to convert page count to number
of kilobytes. Its definition for each architecture could be optimized to
avoid potential numerical overflows.
Diffstat (limited to 'sys/kern/kern_tc.c')
-rw-r--r-- | sys/kern/kern_tc.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c index cda072a..0b35622 100644 --- a/sys/kern/kern_tc.c +++ b/sys/kern/kern_tc.c @@ -37,7 +37,7 @@ * SUCH DAMAGE. * * @(#)kern_clock.c 8.5 (Berkeley) 1/21/94 - * $Id: kern_clock.c,v 1.86 1998/11/29 20:31:02 phk Exp $ + * $Id: kern_clock.c,v 1.87 1999/02/19 14:25:34 luoqi Exp $ */ #include <sys/param.h> @@ -469,10 +469,10 @@ statclock(frame) if ((pstats = p->p_stats) != NULL && (ru = &pstats->p_ru) != NULL && (vm = p->p_vmspace) != NULL) { - ru->ru_ixrss += vm->vm_tsize * PAGE_SIZE / 1024; - ru->ru_idrss += vm->vm_dsize * PAGE_SIZE / 1024; - ru->ru_isrss += vm->vm_ssize * PAGE_SIZE / 1024; - rss = vmspace_resident_count(vm) * PAGE_SIZE / 1024; + ru->ru_ixrss += pgtok(vm->vm_tsize); + ru->ru_idrss += pgtok(vm->vm_dsize); + ru->ru_isrss += pgtok(vm->vm_ssize); + rss = pgtok(vmspace_resident_count(vm)); if (ru->ru_maxrss < rss) ru->ru_maxrss = rss; } |