PERFORCE change 127528 for review

Marko Zec zec at FreeBSD.org
Sun Oct 14 15:00:23 PDT 2007


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

Change 127528 by zec at zec_tpx32 on 2007/10/14 21:59:52

	Per-vprocg load average accounting seems to work fine
	with SCHED_ULE, so remove a stale comment questioning this.
	
	Protect reassignment of a loadavg accounting state from one
	vprocg to another by pinning the thread to current CPU if
	the kernel was configured to use SCHED_ULE.

Affected files ...

.. //depot/projects/vimage/src/sys/kern/kern_exit.c#11 edit
.. //depot/projects/vimage/src/sys/kern/sched_ule.c#14 edit

Differences ...

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

@@ -414,7 +414,7 @@
 	LIST_REMOVE(p, p_list);
 	LIST_INSERT_HEAD(&zombproc, p, p_list);
 	LIST_REMOVE(p, p_hash);
-#if defined(VIMAGE) && defined(SCHED_4BSD) /* XXX what about ULE? */
+#if defined(VIMAGE) && defined(SCHED_4BSD)
 	if (p->p_ucred->cr_vimage->v_procg !=
 	    p->p_pptr->p_ucred->cr_vimage->v_procg) {
 		sched_load_reassign(p->p_ucred->cr_vimage->v_procg,

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

@@ -2625,9 +2625,10 @@
 void
 sched_load_reassign(struct vprocg *old, struct vprocg *new)
 {
-	/* XXX locking! */
+	critical_enter();
 	old->_tdq_load[curcpu]--;
 	new->_tdq_load[curcpu]++;
+	critical_exit();
 }
 #endif
 


More information about the p4-projects mailing list