Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Jan 2008 13:24:01 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 134078 for review
Message-ID:  <200801251324.m0PDO1oc035171@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=134078

Change 134078 by jhb@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;
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200801251324.m0PDO1oc035171>