Zbr's days.
November
Sun Mon Tue Wed Thu Fri Sat
   
30      
2005
Months
Nov

About :: TODO :: Blog :: RSS :: Old blog :: Projects :: GIT :: Gallery :: Notes

Wed, 30 Nov 2005

Receiving zero-copy hacking.


TCP is still missed - if I preallocate 32 pages from VFS, 100 Mbit network overflows them faster than userspace application, which calls sendfile(), commits pages and grabs new, so it is possible to move part of the packet into the last page, but first one is still not commited, so data will be dropped, but sending part will retransmit the whole TCP packet. There are at least two solutions:
1. Do not permit packets which data size is not equal to page size.
2. Preallocate more pages so no overruns can happen.

In case of uncommitted page, we very likely caught following problem: part of the packet has been written into the previous page, but next page contains old data which is not committed to VFS, and we can not overwrite them. In this case we must fallback all writes to the previous pages, so we start from the begining, select one by one the same pages as were selected for writing, and decreases it's zp->used counter, so page starts looking like it was before.

:: Link / Comments (0)

Please solve this captcha to be allowed to post (need to reload in a minute): 24 * 55

Comments are closed for this story.