PERFORCE change 116814 for review

Scott Long scottl at FreeBSD.org
Thu Mar 29 05:04:34 UTC 2007


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

Change 116814 by scottl at scottl-x64 on 2007/03/29 05:04:02

	The changer-mini-scheduler is fundamentally broken; as soon as an
	I/O needs to be deferred, an unescapable spinloop is triggered with
	the SIM lock held.  Avoid this by moving a code block around that
	probably should have been moved around anyways.

Affected files ...

.. //depot/projects/scottl-camlock/src/sys/cam/scsi/scsi_cd.c#16 edit

Differences ...

==== //depot/projects/scottl-camlock/src/sys/cam/scsi/scsi_cd.c#16 (text+ko) ====

@@ -1165,6 +1165,14 @@
 	 */
 	if (changer->devq.qfrozen_cnt > 0) {
 
+		/*
+		 * We always need to reset the frozen count and clear the
+		 * active flag.
+		 */
+		changer->devq.qfrozen_cnt--;
+		changer->cur_device->flags &= ~CD_FLAG_ACTIVE;
+		changer->cur_device->flags &= ~CD_FLAG_SCHED_ON_COMP;
+
 		if (changer->cur_device->outstanding_cmds > 0) {
 			changer->cur_device->flags |= CD_FLAG_SCHED_ON_COMP;
 			changer->cur_device->bufs_left = 
@@ -1179,14 +1187,6 @@
 		}
 
 		/*
-		 * We always need to reset the frozen count and clear the
-		 * active flag.
-		 */
-		changer->devq.qfrozen_cnt--;
-		changer->cur_device->flags &= ~CD_FLAG_ACTIVE;
-		changer->cur_device->flags &= ~CD_FLAG_SCHED_ON_COMP;
-
-		/*
 		 * Check to see whether the current device has any I/O left
 		 * to do.  If so, requeue it at the end of the queue.  If
 		 * not, there is no need to requeue it.


More information about the p4-projects mailing list