public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Old O_DIRECT story
@ 2014-12-27 13:31 Leon Pollak
  2014-12-27 16:08 ` Theodore Ts'o
  2015-01-05 15:52 ` One Thousand Gnomes
  0 siblings, 2 replies; 5+ messages in thread
From: Leon Pollak @ 2014-12-27 13:31 UTC (permalink / raw)
  To: linux-kernel

Hi, all.
There was a discussion here:
https://lkml.org/lkml/2007/1/10/231

Linus wrote in this discussion:
"So don't use O_DIRECT. Use things like madvise() and posix_fadvise()
instead"

After the full week of tests, searches, discussions, I have impudence to
turn to the community - has one tried to implement this approach?

The situation is very simple:
I have the incoming DMA stream using scatter/gather technique. the driver
read() function provides the next ready DMA buffer descriptor with the
virtual address pointer to the acquired data. I need to store this data to
the disk partition as fast as possible, as the incoming stream is too very
fast. According to tests, O_DIRECT/mapping is fast enough, while write() is
not.

I tried in all ways to implement this with mmap(), but it does not success,
because I did not find a way to mmap() file as O_WRONLY. Mapping as O_RDWR
makes kernel to pre-fill mapped memory with partition data. So, kernel and
DMA actually compete on the RAM area to fill it - one with garbage, one
with actual data. Kernel wins.

So, how to implement Linus's advice?
Leon

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

end of thread, other threads:[~2015-01-06  7:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-27 13:31 Old O_DIRECT story Leon Pollak
2014-12-27 16:08 ` Theodore Ts'o
2015-01-05 15:52 ` One Thousand Gnomes
2015-01-06  2:04   ` Kirill A. Shutemov
2015-01-06  7:53     ` Leon Pollak

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