Hi, I should further point out that simply adding O_DIRECT to flip_open does not solve the problem. When I try to flip->read or flip->write with kernel allocated pages I get a EFAULT from somewhere inside the vmm layer. I assume that the DIO layer expects the pages to be allocated and mapped on behalf of the user. By drilling the code it seems that I need to map the pages using get_user_pages but due to the lack of samples/documentation I'm not really sure.
Thanks, Gilboa On Mon, 2005-08-29 at 18:13 +0300, Gilboa Davara wrote: > Hello all, > > Couple of weeks ago I started a thread called "File I/O within kernel > threads?" which ended with a call "for numbers". (Read: Is I/O within > kernel performance increase justifies the development overhead?) > Last week I took my user-land simulator (that takes a file, reads it, > and creates and sends two raw multiplexed streams out of it); and > converted it into a kernel module. > The performance increase was nothing short of staggering: From ~1100Mbps > to ~1700Mbps. (Which is fairly close to the theoretical limit of 2 GbE > NICs.) > While both versions could be further optimized, it's clear that the > kernel version has an very impressive performance lead. > Considering these numbers, I opt to choose a Kernel mode solution. > > My question is simple: > While it's fairly easy to do normal buffered I/O from kernel mode (using > flip_open/close and ->read/->write methods) for the life of me I cannot > seem to find how to do O_DIRECT I/O from kernel mode. > More-ever, as I need a single huge file on a dedicated computer, I don't > really need the FS/VFA/pagecache over-head, AFAIC I rather do raw I/O > directly on-to the target block device. > Can anyone point me into the right direction? > > I'm currently trying to drill down the kernel source but it's a daunting > task, to say the least. > > Again, I fully understand the implications of my request; I understand > that I'm bending Linux sideways, etc. > > Gilboa > > > ================================================================= > To unsubscribe, send mail to [EMAIL PROTECTED] with > the word "unsubscribe" in the message body, e.g., run the command > echo unsubscribe | mail [EMAIL PROTECTED] ================================================================= To unsubscribe, send mail to [EMAIL PROTECTED] with the word "unsubscribe" in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]