PERFORCE change 104647 for review

Chris Jones cdjones at FreeBSD.org
Mon Aug 21 02:10:02 UTC 2006


http://perforce.freebsd.org/chv.cgi?CH=104647

Change 104647 by cdjones at cdjones-impulse on 2006/08/21 02:09:21

	Reduce spamminess, get rid of unused code.

Affected files ...

.. //depot/projects/soc2006/cdjones_jail/src/sys/kern/sched_hier.c#18 edit

Differences ...

==== //depot/projects/soc2006/cdjones_jail/src/sys/kern/sched_hier.c#18 (text+ko) ====

@@ -177,7 +177,7 @@
 static int	forward_wakeup(int  cpunum);
 #endif
 
-static uint32_t total_jail_sched_shares;
+static uint32_t total_cpu_sched_shares;
 static u_int total_est_cpu;
 extern struct mtx allprison_mtx;
 extern int prisoncount;
@@ -572,9 +572,7 @@
 {
 	int nowake;
 	struct prison *pr;
-	u_int32_t nShares = 0;
-	u_int nCpu = 0;
-	unsigned int counter = 0;
+	u_int32_t shares = 0;
 
 	for (;;) {
   	       /* 
@@ -587,16 +585,11 @@
 		* when jail CPU shares are added / changed, rather than
 		* doing it every second.
 		*/
-		nShares = sched_unjailedProcessShares;
-		nCpu = 0;
+		shares = sched_unjailedProcessShares;
 	        LIST_FOREACH(pr, &allprison, pr_list) {
-			nShares += pr->pr_sched_shares;
-			nCpu += pr->pr_estcpu;
+			shares += pr->pr_sched_shares;
    	        }
-		if (0 == (counter % 10)) 
-		  printf("schedcpu_thread: %d CPU shares total, %d / %d CPU est. usage\n", 
-		         nShares, nCpu, total_est_cpu);
-		total_jail_sched_shares = nShares;
+		total_cpu_sched_shares = shares;
 		counter++;
 
 		schedcpu();
@@ -657,7 +650,7 @@
 		   */ 
 			register unsigned int np = newpriority;
 			register unsigned int skew;
-			skew = pr->pr_estcpu * total_jail_sched_shares;
+			skew = pr->pr_estcpu * total_cpu_sched_shares;
 			skew /= max(total_est_cpu, 1) * max(pr->pr_sched_shares, 1);
 			if (skew > 0) {
 				/* wait your turn until your cpu usage's proportionate */
@@ -666,24 +659,10 @@
 			newpriority = min(max(newpriority, PRI_MIN_TIMESHARE),
 			    PRI_MAX_TIMESHARE);
 			}
-/*
-			a = skew;
-			skew *= pr->pr_sched_shares;
-			b = skew;
-			skew *= pr->pr_estcpu;
-			c = skew; */
-			/* avoid divide-by-zero hazards */
-/*			skew /= max(total_jail_sched_shares, 1);
-			d = skew;
-			skew /= max(total_est_cpu, 1);
-			e = skew;
-*/
-
-/*			newpriority += skew; */
 			printf("skew KSE %p (%d / %d cpu, %d / %d shares) from %d to %d\n",
 				&kg, pr->pr_estcpu, total_est_cpu,
 				pr->pr_sched_shares, 
-				total_jail_sched_shares,
+				total_cpu_sched_shares,
 				np, newpriority);
 		}
 		kg->kg_user_pri = newpriority;


More information about the p4-projects mailing list