LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 09-20-2010, 01:46 PM   #1
neeraj.kumar01
LQ Newbie
 
Registered: Sep 2010
Posts: 1

Rep: Reputation: 0
Doing a zero-copy move of data from a kernel buffer to hard disk.


I am trying to move data from a buffer in kernel space into the hard
disk without having to incur any additional copies from kernel buffer to
user buffers or any other kernel buffers. Any ideas/suggestions would be
most helpful.

The use case is basically a demux driver which collects data into a
demux buffer in kernel space and this buffer has to be emptied
periodically by copying the contents into a FUSE-based partition on the
disk. As the buffer gets full, a user process is signalled which then
determines the sector numbers on the disk the contents need to be copied
to.

I was hoping to mmap the above demux kernel buffer into user address
space and issue a write system call to the raw partition device. But
from what I can see, this data is being cached by the kernel on its
way to the Hard Disk driver. And so I am assuming that involves
additional copies by the linux kernel.

At this point I am wondering if there is any other mechansim to do this
without involving additional copies by the kernel. I realize this is an
unsual usage scenario for non-embedded environments, but I would
appreciate any feedback on possible options.

BTW - I have tried using O_DIRECT when opening the raw partition, but
the subsequent write call fails if the buffer being passed is a
mmapped buffer.


Thanx!
 
Old 12-17-2010, 06:48 PM   #2
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
3 months & no replies.

Did you solve your problem?
  • If so, please provide your solution -- it might help someone else w/ the same problem.
  • If not, would you like some help w/ re-phrasing your question, or providing more info.?
 
  


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
Move OS to Another Hard Disk k_oudom Linux - Software 22 10-10-2009 12:51 AM
Copy of IBM Server hard disk data to Another USB External Hard disk mazharcdn Linux - Server 2 09-02-2009 12:41 AM
Copy data from one hard disk to another hard disk vino87 Linux - Desktop 4 08-06-2009 11:37 PM
Hard Disk Failure: How do I move data to a new hard disk drive? spyros Linux - Software 2 10-31-2008 03:01 PM
how to save videos from mplayer buffer to hard disk? shams Fedora 2 08-25-2006 09:33 AM

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

All times are GMT -5. The time now is 06:23 PM.

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