Alignment of disk-I/O from userland.

Ben Mesander ben at timing.com
Tue Oct 7 08:41:21 PDT 2003


Poul-Henning Kamp writes:
 > 1:  Not "on all i/o operations going to a device", but rather "on i/o
 >     operations which take the physread/write fast-path to avoid a copyin/out
 >     overhead."  (disks and tapes mostly).  Ttys, /dev/null and all the
 >     "typical" devices are unaffected.

How about a flag for open(2), such as O_DIRECT, which would indicate
if the fd in question is such a device, and you did not sufficiently
align, etc. your buffers, then you get an error when you attempt the
I/O operation.

If you did not specify this flag when opening the device, then do the
bounce buffer dance for the I/O operation, and lose efficiency.

--Ben



More information about the freebsd-arch mailing list