Date: Thu, 29 Mar 2007 05:04:29 GMT From: Scott Long <scottl@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 116814 for review Message-ID: <200703290504.l2T54ThK089734@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=116814 Change 116814 by scottl@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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200703290504.l2T54ThK089734>