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
期刊:
International Conference on Timely Results in Operating Systems
影响因子:
--
通讯作者:
A. Tanenbaum
A. Tanenbaum
中科院分区:
--
文献类型:
--
作者:
Tomás Hrubý;T. Crivat;H. Bos;A. Tanenbaum

文献摘要

被引文献

相似文献

传统上,应用程序使用套接字来访问网络。套接字API非常容易理解和使用。然而,它的简单性也限制了它在现有实现中的效率。具体地说,套接字API要求应用程序执行许多系统调用,如SELECT、ACCEPT、READ和WRITE。这些调用中的每一个都跨越了用户空间和操作系统之间的保护边界,这是代价高昂的。此外,系统调用本身不是为高并发性而设计的,已经成为现代系统中的瓶颈,在现代系统中,处理并发任务是性能的关键。我们展示了我们可以保留原始的套接字API,而不受当前的限制。具体地说,我们的套接字几乎完全避免了“快速路径”上的系统调用。我们的设计表明,在高负载情况下,我们的设计消除了高达99%的系统调用。也许更能说明问题的是,我们使用套接字来增强NewtOS,这是一个基于微内核的多服务器系统,因此它的网络I/O性能接近,有时甚至超过高度优化的Linux网络堆栈的性能。
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.