Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 Sep 2008 19:36:24 GMT
From:      Julian Elischer <julian@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 149146 for review
Message-ID:  <200809031936.m83JaONu096158@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=149146

Change 149146 by julian@julian_trafmon1 on 2008/09/03 19:36:12

	Remove this from the diff.. we ar enot doing VCPU yet.

Affected files ...

.. //depot/projects/vimage/src/sys/kern/kern_clock.c#19 integrate

Differences ...

==== //depot/projects/vimage/src/sys/kern/kern_clock.c#19 (text+ko) ====

@@ -65,7 +65,6 @@
 #include <sys/interrupt.h>
 #include <sys/limits.h>
 #include <sys/timetc.h>
-#include <sys/vimage.h>
 
 #ifdef GPROF
 #include <sys/gmon.h>
@@ -224,11 +223,6 @@
 int	ticks;
 int	psratio;
 
-#ifdef VIMAGE
-u_int	tot_acc_statcalls;
-int	last_acc_ticks;
-#endif
-
 /*
  * Initialize clock frequencies and start both clocks running.
  */
@@ -453,11 +447,9 @@
 	struct proc *p;
 	long rss;
 	long *cp_time;
-	int sel;
 
 	td = curthread;
 	p = td->td_proc;
-	INIT_VCPU(TD_TO_VCPU(td));
 
 	cp_time = (long *)PCPU_PTR(cp_time);
 	if (usermode) {
@@ -466,9 +458,9 @@
 		 */
 		td->td_uticks++;
 		if (p->p_nice > NZERO)
-			sel = CP_NICE;
+			cp_time[CP_NICE]++;
 		else
-			sel = CP_USER;
+			cp_time[CP_USER]++;
 	} else {
 		/*
 		 * Came from kernel mode, so we were:
@@ -485,53 +477,16 @@
 		if ((td->td_pflags & TDP_ITHREAD) ||
 		    td->td_intr_nesting_level >= 2) {
 			td->td_iticks++;
-			sel = CP_INTR;
+			cp_time[CP_INTR]++;
 		} else {
 			td->td_pticks++;
 			td->td_sticks++;
 			if (!TD_IS_IDLETHREAD(td))
-				sel = CP_SYS;
+				cp_time[CP_SYS]++;
 			else
-				sel = CP_IDLE;
+				cp_time[CP_IDLE]++;
 		}
 	}
-	cp_time[sel]++;
-
-#ifdef VIMAGE
-	if (sel != CP_INTR)
-		sel = CP_IDLE;
-
-	/* Per-vcpu average accounting */
-	mtx_lock_spin(&vcpu_list_mtx);
-	tot_acc_statcalls++;
-	if (!TD_IS_IDLETHREAD(td))
-		V_acc_statcalls++;
-
-	/* Deccay processing every 1/16 seconds */
-	if (last_acc_ticks + (hz >> 4) <= ticks) {
-		u_int weight_fixp;
-		u_int avg0;
-
-		last_acc_ticks = ticks;
-		/*
-		 * avg0, avg1 and avg2 are stored in 16.16 fixed point format.
-		 * weight_fixp is in 1.31 format for better accuracy.
-		 *
-		 * avg1 loses half of its value in roughly 150 ms.
-		 * avg2 loses half of its value in roughly 1350 ms.
-		 */
-		weight_fixp = 0x80000000 / tot_acc_statcalls;
-		/* XXX list locking? */
-		LIST_FOREACH(vcpu, &vcpu_head, vcpu_le) {
-			avg0 = (weight_fixp * V_acc_statcalls) >> 15;
-			V_avg1_fixp = (3 * V_avg1_fixp + avg0) >> 2;
-			V_avg2_fixp = (31 * V_avg2_fixp + avg0) >> 5;
-			V_acc_statcalls = 0;
-		}
-		tot_acc_statcalls = 0;
-	}
-	mtx_unlock_spin(&vcpu_list_mtx);
-#endif
 
 	/* Update resource usage integrals and maximums. */
 	MPASS(p->p_vmspace != NULL);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200809031936.m83JaONu096158>