LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-02-2007, 10:11 AM   #1
zobtempo
LQ Newbie
 
Registered: May 2007
Location: Los Angeles, CA
Distribution: Red Hat WS3 / Fedora Core 6
Posts: 1

Rep: Reputation: 0
file writes to RAID using posix_fadvise vs O_DIRECT


I would extremely benefit from knowing which way is best. I have tried to utilize posix_fadvise(fd,pos,size,POSIX_FADV_DONTNEED) and in another instance O_DIRECT, but both still use the cache unneccessarily.

I have a specific case where I have a device driver that has multiple pci_alloc_consistent buffers that it has mapped into user space through MMAP. Then, my user app maps into those buffers (each 4MB) and then needs to recursively call a file write to send the data over to a striped RAID fully capable of throughputs above 200MB/s, but I only receive 70-90 MB/s. I don't need to look at the data I just accessed in the mmap'd buffer or the file. BUT, the mmap'd buffer will get accessed again, but it will be new data. Maybe there might be a way to tell that the cache is dirty and needs to be refreshed or just forgotten, maybe that's what we're trying to do through the posix_fadvise. I have tried posix_madvise, but I receive errors from the call mostly I suspect because the mmap'd buffers are PCI addressable RAM from pci_alloc_consistent.

My first implementation is a simple write from my mmap'd buffer to the file through a write call.

write(fd,mmap_buffer[i],4*MB);

Or, I use O_DIRECT to open the file and then I create a page aligned buffer with posix_malign to 4MB and then I need to call...

memcpy(malign_buf,mmap_buffer[i],4*MB);
write(fd,malign_buf,4*MB);

I have not had any performace boosts by utilizing posix_fadvise or even O_DIRECT.


Thanks,

Matt
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
gcc question....on solaris....O_DIRECT Petros Koutoupis Solaris / OpenSolaris 2 09-14-2006 01:53 PM
Max read size for O_DIRECT file I/O bigqueso Linux - Software 1 06-02-2006 10:47 AM
Slow writes and reads to my raid array abefroman Linux - Hardware 1 12-20-2005 01:47 AM
Slow writes in software raid 1+0 (Fedora Core 3) spencerkellis Linux - Hardware 0 09-23-2005 01:11 AM
> writes a new file, how to append? luwigie Linux - General 1 08-26-2004 08:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration