Date: Mon, 15 Nov 2004 20:17:30 GMT From: John Baldwin <jhb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 65196 for review Message-ID: <200411152017.iAFKHUvQ005102@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=65196 Change 65196 by jhb@jhb_slimer on 2004/11/15 20:17:23 Ugh, more hacking that may help this further. If this helps, then I think the real fix is going to be to hack on critical sections. Affected files ... .. //depot/projects/smpng/sys/kern/kern_mutex.c#88 edit Differences ... ==== //depot/projects/smpng/sys/kern/kern_mutex.c#88 (text+ko) ==== @@ -577,6 +577,9 @@ int line) { int i = 0; +#ifdef __i386__ + int apic_hack; +#endif if (LOCK_LOG_TEST(&m->mtx_object, opts)) CTR1(KTR_LOCK, "_mtx_lock_spin: %p spinning", m); @@ -587,6 +590,11 @@ /* Give interrupts a chance while we spin. */ critical_exit(); +#ifdef __i386__ + apic_hack = (read_eflags() & PSL_I) == 0; + if (apic_hack) + APIC_IPI_SPINWAIT_ENTER(); +#endif while (m->mtx_lock != MTX_UNOWNED) { if (i++ < 10000000) { cpu_spinwait(); @@ -605,6 +613,10 @@ } cpu_spinwait(); } +#ifdef __i386__ + if (apic_hack) + APIC_IPI_SPINWAIT_EXIT(); +#endif critical_enter(); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200411152017.iAFKHUvQ005102>