Date: Mon, 24 Sep 2007 16:17:13 GMT From: Marko Zec <zec@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 126773 for review Message-ID: <200709241617.l8OGHDQO077246@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=126773 Change 126773 by zec@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 } /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200709241617.l8OGHDQO077246>