transfering pages from user space to user space
From: Pablo Pessolani <hidden>
Date: 2012-12-06 12:59:36
Hi Yann: Reading the patch source code I find that the pages from one user space to other are "copied" 102 if (vm_write) 103 ret = copy_from_user(target_kaddr, 104 lvec[*lvec_current].iov_base 105 + *lvec_offset, 106 bytes_to_copy); 107 else 108 ret = copy_to_user(lvec[*lvec_current].iov_base 109 + *lvec_offset, 110 target_kaddr, bytes_to_copy); The code I wrote (very similar to this) also copies page contents. But my interest is transfering pages (zero-copy). Regards. PAP
Subject: Re: transfering pages from user space to user space From: ydroneaud at opteya.com To: ppessolani at hotmail.com Date: Thu, 6 Dec 2012 10:30:27 +0100 CC: kernelnewbies at kernelnewbies.org Hi, Le mercredi 05 d?cembre 2012 ? 22:47 -0300, Pablo Pessolani a ?crit :quoted
Hi: I am working on a project to copy (page aligned) the buffer content of one process to the buffer of other process. Now I resolved this issue using copy_page() but, analizing performance with different buffer sizes, the "copy_page" becames the critical time component and limiting factor.This sounds a lot like "Cross Memory Support" (eg CROSS_MEMORY_ATTACH option) introduced in Linux 3.2: http://kernelnewbies.org/Linux_3.2#head-a5e26c6275e85a5c9c41873fbab96bd38d934b72 Cross Memory Support add two syscalls: - process_vm_readv() : read from a process memory - process_vm_writev() : write to a process memory Details can be found here: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=fcf634098c00dd9cd247447368495f0b79be12d1 And documentation here: http://www.man7.org/linux/man-pages/man2/process_vm_readv.2.html http://ozlabs.org/~cyeoh/cma/process_vm_readv.txtquoted
[...] The kernel I use is 2.6.32.BTW, why use a kernel released 3 years ago for such new development ? Kernel 2.6.32 was released the 3rd of december 2009. Even the -rt project switch to newer kernel (eg. no less than 3.0, and up to 3.4), see http://rt.wiki.kernel.org/ You should at least switch to a current long term support kernels, for example Linux 3.4. See http://www.kroah.com/log/linux/stable-status-08-2012.html Regards -- Yann Droneaud OPTEYA _______________________________________________ Kernelnewbies mailing list Kernelnewbies at kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
-------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20121206/a517425a/attachment.html