From owner-freebsd-hackers Fri Jan 27 07:40:05 1995 Return-Path: hackers-owner Received: (from root@localhost) by freefall.cdrom.com (8.6.9/8.6.6) id HAA20681 for hackers-outgoing; Fri, 27 Jan 1995 07:40:05 -0800 Received: from hda.com (hda.com [199.232.40.182]) by freefall.cdrom.com (8.6.9/8.6.6) with ESMTP id HAA20669 for ; Fri, 27 Jan 1995 07:39:58 -0800 Received: (dufault@localhost) by hda.com (8.6.9/8.3) id KAA08510; Fri, 27 Jan 1995 10:39:52 -0500 From: Peter Dufault Message-Id: <199501271539.KAA08510@hda.com> Subject: Re: Help with SCSI development (fwd) To: freebsd-hackers@FreeBSD.org Date: Fri, 27 Jan 1995 10:39:51 -0500 (EST) X-Mailer: ELM [version 2.4 PL24] Content-Type: text Content-Length: 4936 Sender: hackers-owner@FreeBSD.org Precedence: bulk Peter Dufault writes: >From owner-freebsd-scsi@freefall.cdrom.com Fri Jan 27 13:31:15 1995 From: Peter Dufault Message-Id: <199501271137.GAA07903@hda.com> Subject: Re: Help with SCSI development To: vernick@cs.sunysb.edu (Michael Vernick) Date: Fri, 27 Jan 1995 06:37:07 -0500 (EST) Cc: freebsd-scsi@FreeBSD.org In-Reply-To: <199501270128.AA07506@cs.sunysb.edu> from "Michael Vernick" at Jan 26, 95 08:28:27 pm X-Mailer: ELM [version 2.4 PL24] Content-Type: text Content-Length: 4132 Sender: freebsd-scsi-owner@FreeBSD.org Precedence: bulk I'm forwarding this to -hackers instead of just -scsi and including the full reference, since it is more than a scsi question. Michael Vernick writes: > > I'm planning to write software using Freebsd that will allow files to > be striped over multiple disks. At first, I plan on implmenting reads > only using a simple file system I plan to eventually write. Since I'm > new to the internals of Freebsd and Unix in general I was hoping that > I could get a little help. I've started going through the code and > have some questions. At first, I'd like to implement this in user > code using 1 process. This process will read the data from each disk. > Are there any direct calls to the scsi driver from user space? I saw > something about user calls in scsi_ioctl.c but couldn't figure out how > to access it. If there are user level calls, are they asynchronous? > What I'd like to do is issue a bunch of reads (1 for each disk) to the > controller all at once and then wait for the data to be returned. If I > can't make asynchronous calls in user space, I guess that I could have > multiple processes, one for each disk, where each process sends a > synchronous read to the driver, and once all of the processes finish, > accumulate the data. > > Eventually, I want to move this into the kernel. When it becomes a > kernel level process, at what level do I issue calls. At the > physio/bread level or lower? Also, I believe that physio and bread > call the scsi strategy function using a function pointer. Where does > this function pointer get set up? Lastly, is there any documentation > where I could get a better handle on how things work within the scsi > part of the IO subsystem? > > Thanks for any help. > > Michael Vernick > > Two overall comments: 1. This is independent of SCSI and more appropriates addressed as a pseudodevice that stripes multiple disk partitions and not just SCSI disk drives. I'm not sure how you configure these stripes to be persistent across reboots. Since it isn't likely that you'll ever boot off them they could get configured in rc after root is mounted and before the other partitions are mounted (the approach on the Alliant systems, which had a similar facility. I'm sure Convex and probably SGI have this also so you may want to look for some man pages). 2. Is your goal size or throughput? For size we still have a 2GB partition limit (maybe 4 but I'm not sure), and for throughput I'm not sure how well the PC architectures will distribute the I/O load across multiple host adapters (though I suppose with disconnect/reconnect and high burst rates to drives with caches it may work fairly well). 3. Sector sizes: In the general case you're likely to wind up with some pretty big sectors that may not work in all situations (I'm just guessing about this). Now, some of your questions: > I saw > something about user calls in scsi_ioctl.c but couldn't figure out how > to access it. Look at scsi(3) and scsi(8) in 2.0-current. This is not present in 2.0-R. > If there are user level calls, are they asynchronous? No. > Eventually, I want to move this into the kernel. When it becomes a > kernel level process, at what level do I issue calls. At the > physio/bread level or lower? Also, I believe that physio and bread > call the scsi strategy function using a function pointer. Where does > this function pointer get set up? Lastly, is there any documentation > where I could get a better handle on how things work within the scsi > part of the IO subsystem? I think the essence will be to have a stripe strategy routine that splits the single buf struct into multiple ones for the underlying drives, loops over the underlying drives calling the strategy routine, and then loops again and calls biodone on the multple devices. Keep in mind that the MTTF for N drives will be roughly N times shorter. Peter -- Peter Dufault Real Time Machine Control and Simulation HD Associates, Inc. Voice: 508 433 6936 dufault@hda.com Fax: 508 433 5267 -- Formerly hd@world.std.com. E-mail problems? Tell hdslip@iii.net -- Peter Dufault Real Time Machine Control and Simulation HD Associates, Inc. Voice: 508 433 6936 dufault@hda.com Fax: 508 433 5267 -- Formerly hd@world.std.com. E-mail problems? Tell hdslip@iii.net