From owner-freebsd-scsi Thu Jan 2 13:59:16 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.4/8.8.4) id NAA06490 for freebsd-scsi-outgoing; Thu, 2 Jan 1997 13:59:16 -0800 (PST) Received: from hda.hda.com (ip96-max1-fitch.ziplink.net [199.232.245.96]) by freefall.freebsd.org (8.8.4/8.8.4) with SMTP id NAA06480 for ; Thu, 2 Jan 1997 13:59:11 -0800 (PST) Received: (from dufault@localhost) by hda.hda.com (8.6.12/8.6.12) id QAA23215; Thu, 2 Jan 1997 16:54:24 -0500 From: Peter Dufault Message-Id: <199701022154.QAA23215@hda.hda.com> Subject: Re: Ideas on CD changers sought In-Reply-To: <199701021747.SAA08128@uriah.heep.sax.de> from J Wunsch at "Jan 2, 97 06:47:14 pm" To: joerg_wunsch@uriah.heep.sax.de Date: Thu, 2 Jan 1997 16:54:23 -0500 (EST) Cc: freebsd-scsi@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL25 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-scsi@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > Something that's on my back-burner for quite some time now: > However, there's still one big problem: concurrent access to the > various CDs. Even two processes using two CDs concurrently now cause > the device to basically start thrashing: the accesses to the media get > intermixed to a degree where the device is finally mostly busy with > swapping media, instead of transferring data. Now the $ 9.99 question > is: what's the best way to avoid this, so some more transfers will be > queued up for one device first, before the LUNs should change? Should > this be CD driver specific, or are other drivers also in need for > this? How about round robin scheduling the platters, maybe with hysteresis on platter switching? Add a "changer queue" that is a queue of CD start queues to schedule the changer resource. A changerstart routine can then round robin schedule across the active platters. Enqueue your buffers into the CD start queue the way it is now. When a CD start queue goes from empty to not-empty, add the CD start queue to the end of the changer queue, and call changerstart if the changer queue went empty to not-empty. Have changerstart schedule up to N transfers in a row for a given unit by calling a derivation of the existing cdstart. If N counts down take the CD start queue off and enqueue it again at the tail of the changer queue and move to the next CD start queue. You want to select N to be a number that gives you decent utilization, maybe enough transfers to take twice as long as the change mechanism. You can still come up with loads that will thrash this. You could add hysteresis to the platter switching with a minimum-time-at-a-platter timeout. If you're feeling ambitious, see if you can set up the CD commands in cd_strategy instead of cdstart and make the queue handling independent of the device type (and outside of the interrupt). This packages up the I/O policy and makes it easier to change in the future. Peter -- Peter Dufault (dufault@hda.com) Realtime Machine Control and Simulation HD Associates, Inc. Voice: 508 433 6936