From owner-p4-projects@FreeBSD.ORG Thu Mar 29 05:04:34 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9477316A404; Thu, 29 Mar 2007 05:04:34 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6E49316A402 for ; Thu, 29 Mar 2007 05:04:34 +0000 (UTC) (envelope-from scottl@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id 5FECE13C459 for ; Thu, 29 Mar 2007 05:04:34 +0000 (UTC) (envelope-from scottl@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.8/8.13.8) with ESMTP id l2T54Til089767 for ; Thu, 29 Mar 2007 05:04:29 GMT (envelope-from scottl@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.8/8.13.8/Submit) id l2T54ThK089734 for perforce@freebsd.org; Thu, 29 Mar 2007 05:04:29 GMT (envelope-from scottl@freebsd.org) Date: Thu, 29 Mar 2007 05:04:29 GMT Message-Id: <200703290504.l2T54ThK089734@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to scottl@freebsd.org using -f From: Scott Long To: Perforce Change Reviews Cc: Subject: PERFORCE change 116814 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Mar 2007 05:04:34 -0000 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.