From 2268be9ff9d2035c942f6a19779e254f317347ba Mon Sep 17 00:00:00 2001 From: Roman Penyaev Date: Thu, 21 Mar 2019 18:10:11 +0100 Subject: [PATCH] os/bluestore: introduce new io_uring IO engine This implements low-level IO engine, which utilizes brand-new io_uring IO interface: https://lwn.net/Articles/776428/ By default libaio is used. If bluestore_ioring=true is set but kernel does not support io_uring or architecture is not x86-64, libaio will be used instead. In current patch liburing library is used in order not to open code everything. In order to compile with liburing WITH_LIBURING=ON should be specified. Signed-off-by: Roman Penyaev --- CMakeLists.txt | 4 + src/common/options.cc | 4 + src/include/config-h.in.cmake | 3 + src/os/CMakeLists.txt | 27 ++++ src/os/bluestore/KernelDevice.cc | 15 +- src/os/bluestore/ceph_io_uring.h | 31 ++++ src/os/bluestore/io_uring.cc | 267 +++++++++++++++++++++++++++++++ 7 files changed, 350 insertions(+), 1 deletion(-) create mode 100644 src/os/bluestore/ceph_io_uring.h create mode 100644 src/os/bluestore/io_uring.cc diff --git a/CMakeLists.txt b/CMakeLists.txt index 49243d0670d..2fe35f0091a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -186,6 +186,10 @@ if(WITH_BLUESTORE) endif() include(CMakeDependentOption) +CMAKE_DEPENDENT_OPTION(WITH_LIBURING "Build with liburing library support" OFF + "WITH_BLUESTORE;HAVE_LIBAIO" OFF) +set(HAVE_LIBURING ${WITH_LIBURING}) + CMAKE_DEPENDENT_OPTION(WITH_BLUESTORE_PMEM "Enable PMDK libraries" OFF "WITH_BLUESTORE" OFF) diff --git a/src/common/options.cc b/src/common/options.cc index 3cd01fe8596..367877296ac 100644 --- a/src/common/options.cc +++ b/src/common/options.cc @@ -4624,6 +4624,10 @@ std::vector