<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&nbsp;the pages from&nbsp;one user space to other&nbsp;are "copied"&nbsp;<BR>
<U><FONT color=#0000ff>102</FONT></U> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(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> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ret&nbsp;=&nbsp;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> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+&nbsp;*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> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ret&nbsp;=&nbsp;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> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+&nbsp;*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> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;target_kaddr,&nbsp;bytes_to_copy);</DIV>
&nbsp;<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>
&nbsp;<BR>
<DIV>
<DIV id=SkyDrivePlaceholder></DIV>&gt; Subject: Re: transfering pages from user space to user space<BR>&gt; From: ydroneaud@opteya.com<BR>&gt; To: ppessolani@hotmail.com<BR>&gt; Date: Thu, 6 Dec 2012 10:30:27 +0100<BR>&gt; CC: kernelnewbies@kernelnewbies.org<BR>&gt; <BR>&gt; Hi,<BR>&gt; <BR>&gt; Le mercredi 05 décembre 2012 à 22:47 -0300, Pablo Pessolani a écrit :<BR>&gt; &gt; Hi:<BR>&gt; &gt; I am working on a project to copy (page aligned) the<BR>&gt; &gt; buffer content of one process to the buffer of other process.<BR>&gt; &gt; <BR>&gt; &gt; Now I resolved this issue using copy_page() but, analizing<BR>&gt; &gt; performance with different buffer sizes, the "copy_page" becames the<BR>&gt; &gt; critical time component and limiting factor.<BR>&gt; <BR>&gt; This sounds a lot like "Cross Memory Support" (eg CROSS_MEMORY_ATTACH<BR>&gt; option) introduced in Linux 3.2:<BR>&gt; <BR>&gt; http://kernelnewbies.org/Linux_3.2#head-a5e26c6275e85a5c9c41873fbab96bd38d934b72<BR>&gt; <BR>&gt; Cross Memory Support add two syscalls:<BR>&gt; - process_vm_readv() : read from a process memory<BR>&gt; - process_vm_writev() : write to a process memory<BR>&gt; <BR>&gt; Details can be found here:<BR>&gt; <BR>&gt; http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=fcf634098c00dd9cd247447368495f0b79be12d1<BR>&gt; <BR>&gt; And documentation here:<BR>&gt; <BR>&gt; http://www.man7.org/linux/man-pages/man2/process_vm_readv.2.html<BR>&gt; http://ozlabs.org/~cyeoh/cma/process_vm_readv.txt<BR>&gt; <BR>&gt; &gt; [...] The kernel I use is 2.6.32.<BR>&gt; &gt; <BR>&gt; <BR>&gt; BTW, why use a kernel released 3 years ago for such new development ?<BR>&gt; Kernel 2.6.32 was released the 3rd of december 2009. Even the -rt<BR>&gt; project switch to newer kernel (eg. no less than 3.0, and up to 3.4),<BR>&gt; see http://rt.wiki.kernel.org/<BR>&gt; <BR>&gt; You should at least switch to a current long term support kernels, for<BR>&gt; example Linux 3.4. See<BR>&gt; http://www.kroah.com/log/linux/stable-status-08-2012.html<BR>&gt; <BR>&gt; Regards<BR>&gt; <BR>&gt; -- <BR>&gt; Yann Droneaud<BR>&gt; OPTEYA<BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; _______________________________________________<BR>&gt; Kernelnewbies mailing list<BR>&gt; Kernelnewbies@kernelnewbies.org<BR>&gt; http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies<BR></DIV>                                               </div></body>
</html>