PERFORCE change 134078 for review

John Baldwin jhb at FreeBSD.org
Fri Jan 25 05:24:02 PST 2008


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

Change 134078 by jhb at jhb_zion on 2008/01/25 13:23:43

	Don't set TDF_INTERRUPT to fake a KSE thread signal when a timeout
	triggers while the thread is still running.  The KSE code controls
	setting and clearing TDF_INTERRUPT, so what would happen is that
	TDF_INTERRUPT would not be cleared until KSE finished sending a
	signal (i.e. never for non-KSE processes) but that while TDF_INTERRUPT
	is set, any sleeps that catch signals would immediately fail with
	EWOULDBLOCK.  Thus, if a non-KSE process hit the race with a timeout
	firing then all future *sleep(... PCATCH ...) or cv_*wait_sig()'s
	would not actually block.

Affected files ...

.. //depot/projects/smpng/sys/kern/subr_sleepqueue.c#34 edit

Differences ...

==== //depot/projects/smpng/sys/kern/subr_sleepqueue.c#34 (text+ko) ====

@@ -817,8 +817,7 @@
 	 * sleepq_catch_signals().
 	 */
 	if (TD_ON_SLEEPQ(td)) {
-		td->td_flags |= TDF_TIMEOUT | TDF_INTERRUPT;
-		td->td_intrval = EWOULDBLOCK;
+		td->td_flags |= TDF_TIMEOUT;
 		thread_unlock(td);
 		return;
 	}


More information about the p4-projects mailing list