On Sockets and System Calls: Minimizing Context Switches for the Socket API
On Sockets and System Calls: Minimizing Context Switches for the Socket API
复制标题
关于套接字和系统调用:最小化套接字 API 的上下文切换
DOI:
--
复制
发表时间:
2014
期刊:
影响因子:
--
通讯作者:
A. Tanenbaum
中科院分区:
文献类型:
--
作者:
Tomás Hrubý;T. Crivat;H. Bos;A. Tanenbaum
Traditionally, applications use sockets to access the network. The socket API is well understood and simple to use. However, its simplicity has also limited its efficiency in existing implementations. Specifically, the socket API requires the application to execute many system calls like select, accept, read, and write. Each of these calls crosses the protection boundary between user space and the operating system, which is expensive. Moreover, the system calls themselves were not designed for high concurrency and have become bottlenecks in modern systems where processing simultaneous tasks is key to performance. We show that we can retain the original socket API without the current limitations. Specifically, our sockets almost completely avoid system calls on the "fast path". We show that our design eliminates up to 99% of the system calls under high load. Perhaps more tellingly, we used our sockets to boost NewtOS, a microkernel-based multiserver system, so that the performance of its network I/O approaches, and sometimes surpasses, the performance of the highly-optimized Linux network stack.