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/subr_smp.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/subr_smp.c')
-rw-r--r-- | sys/kern/subr_smp.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/kern/subr_smp.c b/sys/kern/subr_smp.c index e353284..7785052 100644 --- a/sys/kern/subr_smp.c +++ b/sys/kern/subr_smp.c @@ -22,7 +22,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: mp_machdep.c,v 1.89 1999/01/28 01:59:50 dillon Exp $ + * $Id: mp_machdep.c,v 1.90 1999/02/19 14:25:32 luoqi Exp $ */ #include "opt_smp.h" @@ -2387,10 +2387,10 @@ forwarded_statclock(int id, int pscnt, int *astmap) 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; } |