High-Level Interface with C++20 Coroutines for Asynchronous I/O using io_uring and eBPF

  • Typ der Arbeit: Forschungsprojekt
  • Status der Arbeit: laufend
  • Betreuer: Christian Dietrich

High-Level Interface with C++20 Coroutines for Asynchronous I/O using io_uring and eBPF

In today's operating systems, mode switches between user- and kernel mode due to system calls account for non-negligible run-time overheads [4, 9]. Combined with expensive mitigations against Meltdown and Spectre, system calls can be slowed down by a factor of five [3, 5, 7]. For reducing overheads, multi-system-call interfaces allow to batch successive system calls and submit them with a single mode switch to the kernel [6].

Previous work [8] shows that io_uring [1] can be used as an asynchronous multi-system-call interface in Linux for common userland applications. To reduce mode switches further, io_uring can be combined with eBPF [2] to execute system-call dependent logic inside the kernel. The implementation of both approaches requires us to port existing programs to new programming models, which is a time-consuming effort [10].

To ease the usage of multi-system-calls (e.g., user-level machine code and in-kernel eBPF), this research project will work on a high-level programming interface to abstract from the current event-based programming model that io_uring already provides for eBPF programs. Based on C++20 co-routines, which offer an easy way to express asynchronous event-dependencies as seemingly synchronous code, this research project will provide the means to push parts of waiting functions into the kernelspace. Within Clang/LLVM's existing co-routines support, this thesis will provide an alternative lowering path that extracts code sections between co-routine--suspension points as eBPF functions. Futhermore, the student will propose an interface for choosing betwen execution modes and compare the results against non-io_uring/eBPF and manually-written io_uring/eBPF programs.

Tasks

  • Extend CLang/LLVM to co-compile co-routine sections onto eBPF
  • Basic interface to choose execution modes
  • Compare against against non-io_uring/eBPF and manually-written io_uring/eBPF programs

Literature

  • [1] Axboe, J. Efficient IO with io_uring. 2019.
  • [2] Axboe, J. BPF meets io_uring., 2021.
  • [3] Becker, M., and Chakraborty, S. Measuring software performance on Linux, 2018.
  • [4] Mauro, J., and McDougall, R. Solaris internals: core kernel components, vol. 1. Prentice Hall Professional, 2001.
  • [5] Prout, A., Arcand, W., Bestor, D., Bergeron, B., Byun, C., Gadepally, V., Houle, M., Hubbell, M., Jones, M., Klein, A., et al. Measuring the impact of Spectre and Meltdown. In 2018 IEEE High Performance extreme Computing Conference (HPEC) (2018), IEEE, pp. 1–5.
  • [6] Rajagopalan, M., Debray, S. K., Hiltunen, M. A., and Schlichting, R. D. Cassyopia: Compiler assisted system optimization. In HotOS (2003), vol. 3, pp. 1–5.
  • [7] Schirmeier, H. Revisiting OS multi-calls in the light of Meltdown and KPTI, 2018.
  • [8] Tuneke, F.-B. Analyse von Systemaufrufmustern für POSIX-Sammelschnittstellen. Studienarbeit, TU Dortmund, Dec. 2020.
  • [9] Zadok, E., Callanan, S., Rai, A., Sivathanu, G., and Traeger, A. Efficient and safe execution of user-level code in the kernel. In Parallel and Distributed Processing Symposium (IPDPS’05) (2005).
  • [10] Tuneke, F.-B. Masterarbeit, TU Dortmund, 2021.