lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <E1OyL6H-0002wC-GV@pomaz-ex.szeredi.hu>
Date:	Wed, 22 Sep 2010 10:54:49 +0200
From:	Miklos Szeredi <miklos@...redi.hu>
To:	Neeraj Kumar <neeraj.kumar01@...il.com>
CC:	linux-kernel@...r.kernel.org
Subject: Re: Doing a zero-copy move of data from a kernel buffer to hard disk

On Mon, 20 Sep 2010, Neeraj Kumar wrote:
> 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, the 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.

Isn't this functionality already served by relayfs?

> 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 the
> mmapped buffer.

The other zero-copy  mechanism is splice(2).

Thanks,
Miklos
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ