[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Linux kernel 2.6.x Raw device support

> > It was also stated that in the next kernel development of 2.7 that raw device 
> > support could be removed.  Now I suppose that might be changed by popular 
> > demand as well.
> I believe that the reason for not implementing raw devices on Linux was the fact
> that Linux was designed for x86 and the way Linux did implement DMA to devices 
> would have made a raw device slower than a buffered device.

I believe that your belief is entirely wrong.

I've used the (2.2 and 2.4) /dev/raw/* version of Linux raw devices
for several years now, to create a high-speed disk duplication system.
It runs on commodity X86 hardware, using off-the-shelf PCI-bus UDMA
IDE controllers.

It can copy 1-disk-in, 4-disks-out, DMA direct to/from memory, at
very high speeds.  In fact, it appears to me (based on the timing tests
I've done) that its upper speed limit is not the CPU - it's the total
amount of PCI bus bandwidth to/from memory available.  It's quite a
bit faster than doing a buffered-device copy.

I don't know the reasons behind the apparent decision to switch from
the /dev/raw/ approach, to an O_DIRECT approach, which has apparently
been made in the 2.6 kernel.  I suspect that it has to do with the
"administrative" issues - it eliminates the need to have some sort of
centralized coordination or registry to "manage" the decision of what
underlying devices are bound to which /dev/raw/* pseudodevices.

It may also allow for slightly better security.  With /dev/raw/*
devices of the Linux sort, you have to be root (or be able to run
a suid-root program) to bind the underlying device or partition to
a /dev/raw/* pseudodevice.  With O_DIRECT, you just have to have
read/write access to the device.  The O_DIRECT approach would allow
database partitions (for example) to be made read/write to the
database daemon or program, and accessed directly, with no root-level
administrative access required.

Reply to: