[lkml]   [2007]   [Jan]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: O_DIRECT question
dean gaudet wrote:
> it seems to me that if splice and fadvise and related things are
> sufficient for userland to take care of things "properly" then O_DIRECT
> could be changed into splice/fadvise calls either by a library or in the
> kernel directly...

No, because the semantics are entirely different. An application using
read/write with O_DIRECT expects read() to block until data is
physically fetched from the device. fadvise() does not FORCE the kernel
to discard cache, it only hints that it should, so a read() or mmap()
very well may reuse a cached page instead of fetching from the disk
again. The application also expects write() to block until the data is
on the disk. In the case of a blocking write, you could splice/msync,
but what about aio?

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2007-01-12 17:09    [W:0.182 / U:0.540 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site