<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
Hi Yann:<BR>
<BR>Reading the patch source code I find that the pages from one user space to other are "copied" <BR>
<U><FONT color=#0000ff>102</FONT></U> if (vm_write)<BR>
<DIV class=pre><A id=l103 class=linenr href="http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=mm/process_vm_access.c;h=e920aa3ce104c35b902e8412864c78102fa3177e;hb=fcf634098c00dd9cd247447368495f0b79be12d1#l103">103</A> ret = copy_from_user(target_kaddr,</DIV>
<DIV class=pre><A id=l104 class=linenr href="http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=mm/process_vm_access.c;h=e920aa3ce104c35b902e8412864c78102fa3177e;hb=fcf634098c00dd9cd247447368495f0b79be12d1#l104">104</A> lvec[*lvec_current].iov_base</DIV>
<DIV class=pre><A id=l105 class=linenr href="http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=mm/process_vm_access.c;h=e920aa3ce104c35b902e8412864c78102fa3177e;hb=fcf634098c00dd9cd247447368495f0b79be12d1#l105">105</A> + *lvec_offset,</DIV>
<DIV class=pre><A id=l106 class=linenr href="http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=mm/process_vm_access.c;h=e920aa3ce104c35b902e8412864c78102fa3177e;hb=fcf634098c00dd9cd247447368495f0b79be12d1#l106">106</A> bytes_to_copy);</DIV>
<DIV class=pre><A id=l107 class=linenr href="http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=mm/process_vm_access.c;h=e920aa3ce104c35b902e8412864c78102fa3177e;hb=fcf634098c00dd9cd247447368495f0b79be12d1#l107">107</A> else</DIV>
<DIV class=pre><A id=l108 class=linenr href="http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=mm/process_vm_access.c;h=e920aa3ce104c35b902e8412864c78102fa3177e;hb=fcf634098c00dd9cd247447368495f0b79be12d1#l108">108</A> ret = copy_to_user(lvec[*lvec_current].iov_base</DIV>
<DIV class=pre><A id=l109 class=linenr href="http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=mm/process_vm_access.c;h=e920aa3ce104c35b902e8412864c78102fa3177e;hb=fcf634098c00dd9cd247447368495f0b79be12d1#l109">109</A> + *lvec_offset,</DIV>
<DIV class=pre><A id=l110 class=linenr href="http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=mm/process_vm_access.c;h=e920aa3ce104c35b902e8412864c78102fa3177e;hb=fcf634098c00dd9cd247447368495f0b79be12d1#l110">110</A> target_kaddr, bytes_to_copy);</DIV>
<BR>
The code I wrote (very similar to this) also copies page contents. But my interest is transfering pages (zero-copy).<BR>
Regards.<BR>
PAP<BR>
<BR>
<DIV>
<DIV id=SkyDrivePlaceholder></DIV>> Subject: Re: transfering pages from user space to user space<BR>> From: ydroneaud@opteya.com<BR>> To: ppessolani@hotmail.com<BR>> Date: Thu, 6 Dec 2012 10:30:27 +0100<BR>> CC: kernelnewbies@kernelnewbies.org<BR>> <BR>> Hi,<BR>> <BR>> Le mercredi 05 décembre 2012 à 22:47 -0300, Pablo Pessolani a écrit :<BR>> > Hi:<BR>> > I am working on a project to copy (page aligned) the<BR>> > buffer content of one process to the buffer of other process.<BR>> > <BR>> > Now I resolved this issue using copy_page() but, analizing<BR>> > performance with different buffer sizes, the "copy_page" becames the<BR>> > critical time component and limiting factor.<BR>> <BR>> This sounds a lot like "Cross Memory Support" (eg CROSS_MEMORY_ATTACH<BR>> option) introduced in Linux 3.2:<BR>> <BR>> http://kernelnewbies.org/Linux_3.2#head-a5e26c6275e85a5c9c41873fbab96bd38d934b72<BR>> <BR>> Cross Memory Support add two syscalls:<BR>> - process_vm_readv() : read from a process memory<BR>> - process_vm_writev() : write to a process memory<BR>> <BR>> Details can be found here:<BR>> <BR>> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=fcf634098c00dd9cd247447368495f0b79be12d1<BR>> <BR>> And documentation here:<BR>> <BR>> http://www.man7.org/linux/man-pages/man2/process_vm_readv.2.html<BR>> http://ozlabs.org/~cyeoh/cma/process_vm_readv.txt<BR>> <BR>> > [...] The kernel I use is 2.6.32.<BR>> > <BR>> <BR>> BTW, why use a kernel released 3 years ago for such new development ?<BR>> Kernel 2.6.32 was released the 3rd of december 2009. Even the -rt<BR>> project switch to newer kernel (eg. no less than 3.0, and up to 3.4),<BR>> see http://rt.wiki.kernel.org/<BR>> <BR>> You should at least switch to a current long term support kernels, for<BR>> example Linux 3.4. See<BR>> http://www.kroah.com/log/linux/stable-status-08-2012.html<BR>> <BR>> Regards<BR>> <BR>> -- <BR>> Yann Droneaud<BR>> OPTEYA<BR>> <BR>> <BR>> <BR>> <BR>> _______________________________________________<BR>> Kernelnewbies mailing list<BR>> Kernelnewbies@kernelnewbies.org<BR>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies<BR></DIV>                                            </div></body>
</html>