Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
* raw disk device
@ 1996-03-31  5:00 Steve Peltz
  1996-03-31  5:00 ` Steve Peltz
  1996-04-01  5:00 ` Ron Natalie
  0 siblings, 2 replies; 4+ messages in thread
From: Steve Peltz @ 1996-03-31  5:00 UTC (permalink / raw)


This may be a stupid question, but we haven't figured out the answer yet.

We're trying to use raw disk partitions, and are finding that writing to
the block device (e.g. re9e) is MUCH slower than writing to the character
device (rre9e). Now, I could understand that if they were unaligned access,
but if that's the answer, I've been unable to find the right alignment.
Specifically, I've used 320*7*64 bytes (8*35 512-byte sectors), I'm simply
opening the raw device r/w, and writing without doing any seeks. The 8*512
factor in there should handle any power of 2 block sizing up to 4K.

If I use the character device, I can get about 3800 sectors written
per second; I get less than 1/10th that doing it to the block device.
-- 
Steve Peltz
tricorn@uiuc.edu



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: raw disk device
  1996-03-31  5:00 raw disk device Steve Peltz
@ 1996-03-31  5:00 ` Steve Peltz
  1996-04-01  5:00 ` Ron Natalie
  1 sibling, 0 replies; 4+ messages in thread
From: Steve Peltz @ 1996-03-31  5:00 UTC (permalink / raw)


(deh - sorry, I forgot to include information on our system)

We're running a 2100 5/300 (2 CPU) Digital Unix 3.2D-1 Rev. 41, two
StorageWorks cabinets, RAID controller, 4 2G drives per cabinet, JBOD.
-- 
Steve Peltz
tricorn@uiuc.edu



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: raw disk device
  1996-03-31  5:00 raw disk device Steve Peltz
  1996-03-31  5:00 ` Steve Peltz
@ 1996-04-01  5:00 ` Ron Natalie
  1996-04-01  5:00   ` Steve Peltz
  1 sibling, 1 reply; 4+ messages in thread
From: Ron Natalie @ 1996-04-01  5:00 UTC (permalink / raw)


Steve Peltz (peltz@cerl.uiuc.edu) wrote:
: This may be a stupid question, but we haven't figured out the answer yet.

: We're trying to use raw disk partitions, and are finding that writing to
: the block device (e.g. re9e) is MUCH slower than writing to the character
: device (rre9e). Now, I could understand that if they were unaligned access,
: but if that's the answer, I've been unable to find the right alignment.
: Specifically, I've used 320*7*64 bytes (8*35 512-byte sectors), I'm simply
: opening the raw device r/w, and writing without doing any seeks. The 8*512
: factor in there should handle any power of 2 block sizing up to 4K.

First off, you are confusing the terminonlogy.  UNIX refers to the
character device as the RAW device.  The block device as the cooked
device.  Note that while 'block' is descriptive of the buffered block
devices, the character designator really just means 'not block' (the
original 'non-block' devices were things like terminal interfaces).

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).

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).

What makes you think you want to use the block device?




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: raw disk device
  1996-04-01  5:00 ` Ron Natalie
@ 1996-04-01  5:00   ` Steve Peltz
  0 siblings, 0 replies; 4+ messages in thread
From: Steve Peltz @ 1996-04-01  5:00 UTC (permalink / raw)


In article <4jpgge$hpb@topaz.sensor.com>,
Ron Natalie <ron@topaz.sensor.com> 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



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1996-04-01  5:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-03-31  5:00 raw disk device Steve Peltz
1996-03-31  5:00 ` Steve Peltz
1996-04-01  5:00 ` Ron Natalie
1996-04-01  5:00   ` Steve Peltz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox