NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Zero copy with TCP sockets

If I understand this correctly, NetBSD supports zero copy with TCP
sockets if the data is mapped with mmap() and starts on page boundary.

Could anyone clarify the following points for me:

Assume page size is 4096 bytes (4K) and I write data to TCP socket with:

write(sockfd, buffer, buffer_len)

1. To get zero copy, is it sufficient to have buffer mapped on page
boundary, or do I also have to make sure that buffer_len is a multiple
of page size?

2. Does zero copy work with anonymous memory mappings? For example,
calling mmap(), passing MAP_ANON to it and reusing that memory as file
cache, etc.

3. Are there any issues with mmap() and zero copy on SMP systems?


Home | Main Index | Thread Index | Old Index