From owner-freebsd-scsi@FreeBSD.ORG Fri Feb 2 20:43:09 2007 Return-Path: X-Original-To: scsi@freebsd.org Delivered-To: freebsd-scsi@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9C0FB16A405 for ; Fri, 2 Feb 2007 20:43:09 +0000 (UTC) (envelope-from mjacob@freebsd.org) Received: from ns1.feral.com (ns1.feral.com [192.67.166.1]) by mx1.freebsd.org (Postfix) with ESMTP id 5AC9313C46B for ; Fri, 2 Feb 2007 20:43:09 +0000 (UTC) (envelope-from mjacob@freebsd.org) Received: from ns1.feral.com (localhost [127.0.0.1]) by ns1.feral.com (8.13.8/8.13.8) with ESMTP id l12Kh112037063; Fri, 2 Feb 2007 12:43:09 -0800 (PST) (envelope-from mjacob@freebsd.org) Received: from localhost (mjacob@localhost) by ns1.feral.com (8.13.8/8.13.8/Submit) with ESMTP id l12Kh1Nk037060; Fri, 2 Feb 2007 12:43:01 -0800 (PST) (envelope-from mjacob@freebsd.org) X-Authentication-Warning: ns1.feral.com: mjacob owned process doing -bs Date: Fri, 2 Feb 2007 12:43:01 -0800 (PST) From: mjacob@freebsd.org To: Scott Long In-Reply-To: <45C389A6.1080606@samsco.org> Message-ID: <20070202123844.U36488@ns1.feral.com> References: <20070123173026.E692416A4CD@hub.freebsd.org> <45B65710.4060607@root.org> <20070123105009.G41619@ns1.feral.com> <45B67401.9070102@samsco.org> <20070201150111.B77236@ns1.feral.com> <45C27965.1010803@samsco.org> <45C2E7DB.30204@root.org> <20070202080329.L17850@ns1.feral.com> <45C389A6.1080606@samsco.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: scsi@freebsd.org, mjacob@freebsd.org, Nate Lawson Subject: Re: cvs commit: src/sys/cam/scsi scsi_da.c X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: mjacob@freebsd.org List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Feb 2007 20:43:09 -0000 >> >> From a silly semantic point of view to get around this, we should still >> support and require SYNC_CACHE on close except where devices don't support >> it (and any device that hangs on a SYNC_CACHE doesn't support it- period). > > The problem is that we don't know if the device will misbehave until it > does, and then we don't know if we can reliably recover it. This is back to what I referred to earlier by a week or so- booting installation (or as a fallback) with a pessimization flag that avoids all questionable commands until the system is up enough to load (via firmware(9) or sysctl or rc scripts) better information. > >> On detach, devices that still need to have data commited via an opcode that >> looks remarkably like SYNC_CACHE can and should have that happen- with all >> the infrastructure changes that go along with allowing devices to be >> detached (w/o complaint) with a live command. > > What instigates this problem is that the GEOM layer will open the > device, read a few sectors, close it, then do that again a few more > times, long before the user tries to mount/unmount it. It's the whole > GEOM-taste thing where it tries to essentially auto-probe the storage. > When we unconditionally send a SYNC_CACHE in daclose(), the > misbehaving device is dead long before the user has a chance to do > anything. One hack might be to track if any write command were done > while the device was open, and only issue the SYNC_CACHE if so. > Since the GEOM tasting will only read, it'll pass this test and avoid > the problem. It's not a hack to keep track of a write commands- after all, I did exactly this for SunOS 4.1 (or was it 4.0?) to know whether you'd dirtied the device or not- and of course *I* would be believe it to still be perfect, eh? :-) This would be an excellent and cheap idea to implement and I think I'll do so. I bet you that this will take care of nearly all of the boot time issues.