Thread (5 messages) 5 messages, 4 authors, 2011-07-12

data transfer from kernel to user space

From: Amit Nagal <hidden>
Date: 2011-07-12 06:56:35

On Tue, Jul 12, 2011 at 11:51 AM, Tirtha Ghosh [off-list ref] wrote:
Use a shared memory between user space and kernel space.
The same physical memory can be translated as user-space virtual address as
well as kernel space.
See more about mmap,?io_remap_pfn_range etc. and you will get an idea.
The main advantage with this u can avoid copying data between two spaces but
disadvantage associated is u need to request ?a fixed memory chunk from
kernel for this purpose.
Thanx for reply . Regarding mmap usage , As per  LDD3 , page 423 :
"Not every device lends itself to the mmap abstraction; it makes no
sense, for instance, for serial ports and other stream-oriented
devices." .

why mmap is not useful for stream-oriented devices ?
After all even for stream-oriented device (as in my case ) , we need
to copy data from kernel buffer to user-space buffer ,
and if copy can be avoided via any mechanism , it will be much faster  .

Regards
Amit Nagal
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help