From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,dcfbec7fa1ce4b94 X-Google-Attributes: gid1164f8,public From: peltz@cerl.uiuc.edu (Steve Peltz) Subject: Re: raw disk device Date: 1996/04/01 Message-ID: <4jpnjb$9pi@vixen.cso.uiuc.edu>#1/1 X-Deja-AN: 145310542 references: <4jn11n$bvr@vixen.cso.uiuc.edu> <4jpgge$hpb@topaz.sensor.com> organization: University Communications, Inc. newsgroups: comp.sys.dec In article <4jpgge$hpb@topaz.sensor.com>, Ron Natalie wrote: >First off, you are confusing the terminonlogy. UNIX refers to the >character device as the RAW device. The block device as the cooked >device. My use of "raw" was with regards to disk partitions, i.e. not putting a file system on it. None of the documentation I've seen has ever used any special term for the block device other than it being a block device. The only reference to "cooked" I've ever heard is with regard to tty devices. >The RAW device transfers directly from your user memory to the device >controller. It will always give you the fastest performance if you >can deal with the constraints involved (alignment/transfer size, etc). Both the man page (under mknod) and the "Writing Device Drivers" documentation indicate that "block device drivers are particularly well suited for disk drives". We aren't running out of CPU time or buffer space, it is just that the actual write from the buffers to the disk is taking a LONG LONG time, and that doesn't seem like it ought to happen. We actually do prefer that the I/O go through a buffer cache so that re-reads of the same location will not require a physical access. We'd also prefer that the process not need to wait for a physical write to complete, so the copy to a kernel buffer is just fine, even if it means a little more CPU time all around to do the copying. Note that a READ does not take 10 times as long when going through the block device. >The COOKED device is buffered through the kernel buffer cache and always >involves at least one extra copy and perhaps will break your I/O request >up (you do not have control over it). Note that the devices that are mounted are the block devices, not the character devices. >What makes you think you want to use the block device? We're putting our own file system on it. We could simply create a 2G file and read/write to that, but I figured that bypassing the file system would be somewhat faster. -- Steve Peltz tricorn@uiuc.edu