From e87e1806d8658321bc239a8d690b0376ee36ebc8 Mon Sep 17 00:00:00 2001 From: chenerqi Date: Mon, 28 Dec 2020 21:03:13 +0800 Subject: [PATCH] librbd: optionally exclude ops from qos Optionally exclude ops from qos, set by a set of comma-delimated keys, for example discards w/mkfs (instead of disabling it) in combination with QoS BPS limits, exclude discard ops can control cluster storage capacity usage and client network bandwith at the same time. Signed-off-by: Erqi Chen Signed-off-by: Shuai Ni --- src/CMakeLists.txt | 1 + src/common/options.cc | 26 ++++- src/crimson/CMakeLists.txt | 1 + src/librbd/CMakeLists.txt | 1 + src/librbd/ImageCtx.cc | 4 + src/librbd/io/ImageDispatcher.cc | 5 + src/librbd/io/ImageDispatcher.h | 1 + src/librbd/io/ImageDispatcherInterface.h | 1 + src/librbd/io/IoOperations.cc | 101 ++++++++++++++++++ src/librbd/io/IoOperations.h | 18 ++++ src/librbd/io/QosImageDispatch.cc | 25 +++++ src/librbd/io/QosImageDispatch.h | 2 + src/librbd/io/Types.h | 15 +++ src/test/common/test_context.cc | 2 +- src/test/librbd/mock/io/MockImageDispatcher.h | 1 + 15 files changed, 202 insertions(+), 2 deletions(-) create mode 100644 src/librbd/io/IoOperations.cc create mode 100644 src/librbd/io/IoOperations.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d5ce19c54b75..05235b691852 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -385,6 +385,7 @@ set(libcommon_files osdc/Objecter.cc osdc/error_code.cc librbd/Features.cc + librbd/io/IoOperations.cc ${mds_files}) set_source_files_properties(ceph_ver.c APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_BINARY_DIR}/src/include/ceph_ver.h) diff --git a/src/common/options.cc b/src/common/options.cc index 367e52ee0dba..afa64f661b36 100644 --- a/src/common/options.cc +++ b/src/common/options.cc @@ -15,8 +15,9 @@ // Definitions for enums #include "common/perf_counters.h" -// rbd feature validation +// rbd feature and io operation validation #include "librbd/Features.h" +#include "librbd/io/IoOperations.h" using std::ostream; using std::ostringstream; @@ -7683,6 +7684,29 @@ static std::vector