4 ms·
Do you really need to do a full copy? What if you had a shared page and notified the user process when the data in the page was available at a certain offset.
by pradn 8y ago
Do you really need to do a full copy? What if you had a shared page and notified the user process when the data in the page was available at a certain offset.
Take a look at this paper (FlexSC: Flexible System Call Scheduling with Exception-Less System Calls):
https://www.usenix.org/legacy/event/osdi10/tech/full_papers/Soares.pdf https://www.usenix.org/legacy/event/osdi10/tech/full_papers/...
- tlb 8y agoSharing pages between user processes and kernel is extremely bug-prone, because threads in the user process can mutate the data while the kernel is reading it, leading to all kinds of race conditions. You can't depend on user processes respecting mutexes for security. You can make this work by removing the page from the user process before making it available to the kernel, but the synchronization overhead of doing this (especially on a NUMA system) is probably worse than copying moderate amounts of data.
- pradn 8y agoHmm. Perhaps temporarily switching the TLB entry to read-only mode for that page during kernel accesses? There might be some interesting software-hardware co-design solutions here.