Date: Mon, 11 Nov 2002 13:02:36 -0800 (PST) From: John Baldwin <jhb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 20975 for review Message-ID: <200211112102.gABL2ajg093726@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=20975 Change 20975 by jhb@jhb_laptop on 2002/11/11 13:02:15 Change callers of witness_list() to use WITNESS_WARN() instead. Affected files ... .. //depot/projects/smpng/sys/alpha/alpha/trap.c#40 edit .. //depot/projects/smpng/sys/i386/i386/trap.c#46 edit .. //depot/projects/smpng/sys/ia64/ia64/trap.c#39 edit .. //depot/projects/smpng/sys/kern/subr_mbuf.c#21 edit .. //depot/projects/smpng/sys/kern/subr_trap.c#42 edit .. //depot/projects/smpng/sys/powerpc/powerpc/trap.c#27 edit .. //depot/projects/smpng/sys/sparc64/sparc64/trap.c#43 edit Differences ... ==== //depot/projects/smpng/sys/alpha/alpha/trap.c#40 (text+ko) ==== @@ -789,12 +789,8 @@ #ifdef INVARIANTS cred_free_thread(td); #endif -#ifdef WITNESS - if (witness_list(td)) { - panic("system call %s returning with mutex(s) held\n", - syscallnames[code]); - } -#endif + WITNESS_WARN(WARN_PANIC, NULL, "System call %s returning", + syscallnames[code]); mtx_assert(&sched_lock, MA_NOTOWNED); mtx_assert(&Giant, MA_NOTOWNED); } ==== //depot/projects/smpng/sys/i386/i386/trap.c#46 (text+ko) ==== @@ -1099,13 +1099,8 @@ #ifdef INVARIANTS cred_free_thread(td); #endif - -#ifdef WITNESS - if (witness_list(td)) { - panic("system call %s returning with mutex(s) held\n", - syscallnames[code]); - } -#endif + WITNESS_WARN(WARN_PANIC, NULL, "System call %s returning", + syscallnames[code]); mtx_assert(&sched_lock, MA_NOTOWNED); mtx_assert(&Giant, MA_NOTOWNED); } ==== //depot/projects/smpng/sys/ia64/ia64/trap.c#39 (text+ko) ==== @@ -905,12 +905,8 @@ #ifdef INVARIANTS cred_free_thread(td); #endif -#ifdef WITNESS - if (witness_list(td)) { - panic("system call %s returning with mutex(s) held\n", - syscallnames[code]); - } -#endif + WITNESS_WARN(WARN_PANIC, NULL, "System call %s returning", + syscallnames[code]); mtx_assert(&sched_lock, MA_NOTOWNED); mtx_assert(&Giant, MA_NOTOWNED); } @@ -1082,13 +1078,8 @@ #ifdef INVARIANTS cred_free_thread(td); #endif - -#ifdef WITNESS - if (witness_list(td)) { - panic("system call %s returning with mutex(s) held\n", - syscallnames[code]); - } -#endif + WITNESS_WARN(WARN_PANIC, NULL, "System call %s returning", + syscallnames[code]); mtx_assert(&sched_lock, MA_NOTOWNED); mtx_assert(&Giant, MA_NOTOWNED); } ==== //depot/projects/smpng/sys/kern/subr_mbuf.c#21 (text+ko) ==== @@ -999,15 +999,8 @@ struct domain *dp; struct protosw *pr; -/* - * XXX: Argh, we almost always trip here with witness turned on now-a-days - * XXX: because we often come in with Giant held. For now, there's no way - * XXX: to avoid this. - */ -#ifdef WITNESS - KASSERT(witness_list(curthread) == 0, - ("mb_reclaim() called with locks held")); -#endif + WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK | WARN_PANIC, NULL, + "mb_reclaim()"); mbstat.m_drain++; /* XXX: No consistency. */ ==== //depot/projects/smpng/sys/kern/subr_trap.c#42 (text+ko) ==== @@ -163,10 +163,7 @@ CTR3(KTR_SYSC, "ast: thread %p (pid %d, %s)", td, p->p_pid, p->p_comm); KASSERT(TRAPF_USERMODE(framep), ("ast in kernel mode")); -#ifdef WITNESS - if (witness_list(td)) - panic("Returning to user mode with mutex(s) held"); -#endif + WITNESS_WARN(WARN_PANIC, NULL, "Returning to user mode"); mtx_assert(&Giant, MA_NOTOWNED); mtx_assert(&sched_lock, MA_NOTOWNED); td->td_frame = framep; ==== //depot/projects/smpng/sys/powerpc/powerpc/trap.c#27 (text+ko) ==== @@ -473,12 +473,8 @@ */ STOPEVENT(p, S_SCX, code); -#ifdef WITNESS - if (witness_list(td)) { - panic("system call %s returning with mutex(s) held\n", - syscallnames[code]); - } -#endif + WITNESS_WARN(WARN_PANIC, NULL, "System call %s returning", + syscallnames[code]); mtx_assert(&sched_lock, MA_NOTOWNED); mtx_assert(&Giant, MA_NOTOWNED); } ==== //depot/projects/smpng/sys/sparc64/sparc64/trap.c#43 (text+ko) ==== @@ -632,12 +632,8 @@ #ifdef INVARIANTS cred_free_thread(td); #endif -#ifdef WITNESS - if (witness_list(td)) { - panic("system call %s returning with mutex(s) held\n", - syscallnames[code]); - } -#endif + WITNESS_WARN(WARN_PANIC, NULL, "System call %s returning", + syscallnames[code]); mtx_assert(&sched_lock, MA_NOTOWNED); mtx_assert(&Giant, MA_NOTOWNED); } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200211112102.gABL2ajg093726>