Module Name:    src
Committed By:   christos
Date:           Sun Oct 30 01:57:40 UTC 2011

Modified Files:
        src/sys/kern: kern_clock.c

Log Message:
Back out previous; this should not be done in statclock but when the
allocations change or getrusage(). Plus the += seems wrong, we cannot
keep adding to the stats.


To generate a diff of this commit:
cvs rdiff -u -r1.129 -r1.130 src/sys/kern/kern_clock.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/kern_clock.c
diff -u src/sys/kern/kern_clock.c:1.129 src/sys/kern/kern_clock.c:1.130
--- src/sys/kern/kern_clock.c:1.129	Sat Oct 29 11:58:38 2011
+++ src/sys/kern/kern_clock.c	Sat Oct 29 21:57:40 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_clock.c,v 1.129 2011/10/29 15:58:38 christos Exp $	*/
+/*	$NetBSD: kern_clock.c,v 1.130 2011/10/30 01:57:40 christos Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2004, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -69,7 +69,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_clock.c,v 1.129 2011/10/29 15:58:38 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_clock.c,v 1.130 2011/10/30 01:57:40 christos Exp $");
 
 #include "opt_ntp.h"
 #include "opt_perfctrs.h"
@@ -429,32 +429,7 @@ statclock(struct clockframe *frame)
 	}
 	spc->spc_pscnt = psdiv;
 
-        /*
-         * If the CPU is currently scheduled to a non-idle process, then charge
-         * that process with the appropriate VM resource utilization for a tick.
-         *
-         * Assume that the current process has been running the entire last
-         * tick, and account for VM use regardless of whether in user mode or
-         * system mode (XXX or interrupt mode?).
-         *
-         * rusage VM stats are expressed in kilobytes * ticks-of-execution.
-         */
-        /* based on code from 4.3BSD kern_clock.c and from FreeBSD */
- 
 	if (p != NULL) {
-		struct vmspace *vm = p->p_vmspace;
-		struct rusage *ru = &p->p_stats->p_ru;
-		long rss;
- 
-#define pg2kb(n)	(((n) * PAGE_SIZE) / 1024)
-		ru->ru_idrss += pg2kb(vm->vm_dsize); /* unshared data */
-		ru->ru_isrss += pg2kb(vm->vm_ssize); /* unshared stack */
-		ru->ru_ixrss += pg2kb(vm->vm_tsize); /* "shared" text? */
- 
-		rss = pg2kb(vm_resident_count(vm));
-		if (rss > ru->ru_maxrss)
-			ru->ru_maxrss = rss;
-
 		atomic_inc_uint(&l->l_cpticks);
 		mutex_spin_exit(&p->p_stmutex);
 	}

Reply via email to