performance improvement while reading network data
Recently we developed a network buffering algorithm where we allocate
large chunk of memory and reuse it to store and consume network messages.
My question is, we are allocating this large memory in user space. First network buffers from network device drivers are copied to user
space from kernel space and then all the above operations are performed.
Copying this network data from kernel to user space is still an
Can we have a way so that this kernel to user space memory copying can
be avoided all together ??
My thinking was that there can be two ways to perform this ..
1. Either Network device driver stores the network data as in the
above algorithm and consumer thread will read the data from kernel memory.
There is a problem that we will have to allocate large amount of
kernel memory which could lead to disasters if any bugs are present. So proper care should be taken.
(Something like network buffering algo will mmap in kernel memory space.)
2. Other way could be to modify network device driver so that using
mmap system call, directly map network data to user space rather than kernel memory space and then network buffering algo will read this data from user space directly.
Can you give me some feedback
If this can be achieved? What are the issues associated? Any good reading material will be nice.