PERFORCE change 126773 for review

Marko Zec zec at FreeBSD.org
Mon Sep 24 09:17:14 PDT 2007


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

Change 126773 by zec at zec_tca51 on 2007/09/24 16:16:25

	Rearrange a few lines in schedcpu() in a desperate attempt
	to catch a difficult to reproduce panic observed there after
	change 126517 went in, i.e. after load average accounting
	having been split into per-vprocg counters.
	
	The panic was observed (but not traced nor dump saved) a few
	times just after system bootup, with only the default
	vimage/vprocg configured.

Affected files ...

.. //depot/projects/vimage/src/sys/kern/sched_4bsd.c#10 edit

Differences ...

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

@@ -390,8 +390,6 @@
 {
 #ifndef VIMAGE
 	register fixpt_t loadfac = loadfactor(averunnable.ldavg[0]);
-#else
-	#define loadfac loadfactor(td->td_ucred->cr_vimage->v_procg->_averunnable.ldavg[0])
 #endif
 	struct thread *td;
 	struct proc *p;
@@ -402,6 +400,13 @@
 	sx_slock(&allproc_lock);
 	FOREACH_PROC_IN_SYSTEM(p) {
 		PROC_SLOCK(p);
+#ifdef VIMAGE
+		KASSERT((p->p_ucred != NULL), ("p_ucred"));
+		KASSERT((p->p_ucred->cr_vimage != NULL), ("cr_vimage"));
+		KASSERT((p->p_ucred->cr_vimage->v_procg != NULL), ("v_procg"));
+		INIT_VPROCG(p->p_ucred->cr_vimage->v_procg);
+		fixpt_t loadfac = loadfactor(V_averunnable.ldavg[0]);
+#endif
 		/*
 		 * Increment time in/out of memory.  We ignore overflow; with
 		 * 16-bit int's (remember them?) overflow takes 45 days.
@@ -490,9 +495,6 @@
 		PROC_SUNLOCK(p);
 	} /* end of process loop */
 	sx_sunlock(&allproc_lock);
-#ifdef VIMAGE
-#undef loadfac
-#endif
 }
 
 /*


More information about the p4-projects mailing list