Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

zero copy from kernel perspective

267 views
Skip to first unread message

mayank rana

unread,
Nov 17, 2006, 12:23:58 AM11/17/06
to
   Hi to all,

I am trying to implement zero copy concept. I understood concept of zero copy but how to use it or implement it from kernel perspective.......
I want to know API regarding that. I want to copy large chunk of data from one machine kernel space to other machine.
 Can anyone give me pointer to that ?


Thanks.

Regards,
_-_Mayank Rana_-_
"The greatest pleasure in life is to do what people say U cann't do."


Sponsored Link

Degrees online in as fast as 1 Yr - MBA, Bachelor's, Master's, Associate - Click now to apply

Mulyadi Santosa

unread,
Nov 20, 2006, 12:11:30 AM11/20/06
to
Hi...

> Hi to all,
>
> I am trying to implement zero copy concept. I understood concept of
> zero copy but how to use it or implement it from kernel
> perspective....... I want to know API regarding that. I want to copy
> large chunk of data from one machine kernel space to other machine.
> Can anyone give me pointer to that ?

Are you looking for something like sendfile()? Sorry, I (and probably
others) aren't clear about your true intention here...

regards,

Mulyadi


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/


mayank rana

unread,
Nov 21, 2006, 2:07:09 AM11/21/06
to
Hi,

I am working on client server application.
I want to know how to implement zero copy from socket point of view. Like for example when we received something on socket, how is the zero copy concept implemented here? I am not able to understand how we can use that chunk of data from socket into my application without making a copy of it.


Thanks.

Regards,
_-_Mayank Rana_-_

Mulyadi Santosa <mulyadi...@gmail.com> wrote:
Hi...
> Hi to all,
>
> I am trying to implement zero copy concept. I understood concept of
> zero copy but how to use it or implement it from kernel
> perspective....... I want to know API regarding that. I want to copy
> large chunk of data from one machine kernel space to other machine.
> Can anyone giv e me pointer to that ?


Are you looking for something like sendfile()? Sorry, I (and probably
others) aren't clear about your true intention here...

regards,

Mulyadi



Sponsored Link

Mortgage rates near 39yr lows. $420,000 Mortgage for $1,399/mo - Calculate new house payment

SDiZ

unread,
Nov 21, 2006, 10:25:21 AM11/21/06
to
mayank rana wrote:
> Hi,
>
> I am working on client server application.
> I want to know how to implement zero copy from socket point of view.
> Like for example when we received something on socket, how is the zero
> copy concept implemented here? I am not able to understand how we can
> use that chunk of data from socket into my application without making a
> copy of it.

use MMAP.

>
> Thanks.
>
> Regards,
> _-_Mayank Rana_-_

Mulyadi Santosa

unread,
Nov 22, 2006, 10:05:08 AM11/22/06
to
Hi...

> I am working on client server application.
> I want to know how to implement zero copy from socket point of view.
> Like for example when we received something on socket, how is the
> zero copy concept implemented here? I am not able to understand how
> we can use that chunk of data from socket into my application without
> making a copy of it.

Well, here is the illustration:

when a packet is received from the network card, interrupt handler put
it on kernel space memory. Through functions, it is brought to the
listener socket. The system call which is listening for it, take the
buffer, copy it to user space buffer and continue to do another
capture.

So how about zero copy? In zero copy, there is no copying from kernel to
user space. Either the kernel mode page which holds the data is
remapped to user space, or it is the user space pages which is also
mapped to kernel space, that is used to keep the packets. Via
remapping, data duplication is avoided because the page(s) are now
accessible from kernel and user space's point of view.

Of course, there is a complication for this nice feature. The pages must
be locked so they always exist in RAM, if not : either the work will
get longer (since the page must be brought back to RAM) or kernel get
panics (if data is accessed in uninterruptible style).

I am not too familiar with real world implementation of so called zero
copy network, so I could say something wrong here. Somebody please
CMIIW.

regards,

Mulyadi

Mulyadi Santosa

unread,
Nov 21, 2006, 9:53:37 AM11/21/06
to
Hi...

> I am working on client server application.
> I want to know how to implement zero copy from socket point of view.
> Like for example when we received something on socket, how is the
> zero copy concept implemented here? I am not able to understand how
> we can use that chunk of data from socket into my application without
> making a copy of it.

Well, here is the illustration:

0 new messages