From 17f9da3466ae2610fe8259d521e742927e81db5c Mon Sep 17 00:00:00 2001 From: songyuhang Date: Wed, 12 Apr 2023 09:12:45 +0800 Subject: [PATCH] add gc_passby config && add optimiser --- patch/ceph-global-cache.patch | 577 +++++++++++++++++++++++++++++----- 1 file changed, 507 insertions(+), 70 deletions(-) diff --git a/patch/ceph-global-cache.patch b/patch/ceph-global-cache.patch index 36ad22c..5e29559 100644 --- a/patch/ceph-global-cache.patch +++ b/patch/ceph-global-cache.patch @@ -40,7 +40,7 @@ index 28ec9835..bc11ec5f 100644 if(WITH_TESTS) diff --git a/src/client_adaptor/CMakeLists.txt b/src/client_adaptor/CMakeLists.txt new file mode 100644 -index 00000000..75e0a7a3 +index 00000000..1bdda286 --- /dev/null +++ b/src/client_adaptor/CMakeLists.txt @@ -0,0 +1,16 @@ @@ -53,7 +53,7 @@ index 00000000..75e0a7a3 + +add_library(ceph_client_adaptor_plugin SHARED ${client_adaptor_srcs}) +message(STATUS "In cliend adaptor third part directory --> " ${third_part_dir}) -+target_link_libraries(ceph_client_adaptor_plugin osdc agent_client_lib das) ++target_link_libraries(ceph_client_adaptor_plugin osdc agent_client_lib das dplog) + + +set(client_adaptor_dir ${CEPH_INSTALL_PKGLIBDIR}) @@ -62,10 +62,10 @@ index 00000000..75e0a7a3 +message(STATUS "Global Cache client-adaptor cmake executing...") diff --git a/src/client_adaptor/ClientAdaptorMgr.cc b/src/client_adaptor/ClientAdaptorMgr.cc new file mode 100644 -index 00000000..9a4ed2ce +index 00000000..cd2611cb --- /dev/null +++ b/src/client_adaptor/ClientAdaptorMgr.cc -@@ -0,0 +1,256 @@ +@@ -0,0 +1,261 @@ +/* License:LGPL-2.1 +* +* Copyright (c) 2021 Huawei Technologies Co., Ltd All rights reserved. @@ -322,12 +322,17 @@ index 00000000..9a4ed2ce + } + return ret; +} ++ ++void ClientAdaptorCcm::init_dplog() ++{ ++ dplog(883, 6, (char *)__FILE__, __LINE__, __func__, 0, "gc bypass"); ++} diff --git a/src/client_adaptor/ClientAdaptorMgr.h b/src/client_adaptor/ClientAdaptorMgr.h new file mode 100644 -index 00000000..6903a293 +index 00000000..52ad3882 --- /dev/null +++ b/src/client_adaptor/ClientAdaptorMgr.h -@@ -0,0 +1,189 @@ +@@ -0,0 +1,195 @@ +/* License:LGPL-2.1 +* +* Copyright (c) 2021 Huawei Technologies Co., Ltd All rights reserved. @@ -392,6 +397,8 @@ index 00000000..6903a293 + + virtual int32_t gc_snap_is_rollbacking(int64_t data_pool_id, const std::string image_id, int64_t snap_id) = 0; + ++ virtual void init_dplog() = 0; ++ + virtual const std::string name(){ + return "ClientAdaptorMgr"; + } @@ -436,6 +443,8 @@ index 00000000..6903a293 + + int32_t gc_snap_is_rollbacking(int64_t data_pool_id, const std::string image_id, int64_t snap_id); + ++ void init_dplog(); ++ + const std::string name() override { + return "ClientAdaptorCcm"; + } @@ -510,6 +519,8 @@ index 00000000..6903a293 + bool get_pt_status(int32_t clusterid, uint32_t pt_id) { + return true; + } ++ ++ void init_dplog() { } + void ccm_deregister(Objecter *obj) {} + +private: @@ -1229,10 +1240,10 @@ index 00000000..3509005f +#endif diff --git a/src/client_adaptor/open_ccm.h b/src/client_adaptor/open_ccm.h new file mode 100644 -index 00000000..db87f7d1 +index 00000000..2f48890d --- /dev/null +++ b/src/client_adaptor/open_ccm.h -@@ -0,0 +1,248 @@ +@@ -0,0 +1,251 @@ +/* +Copyright (c) 2021 Huawei Technologies Co., Ltd All rights reserved. + @@ -1476,6 +1487,9 @@ index 00000000..db87f7d1 + +int32_t OpenSnapshotBusy(int64_t dataPoolId, const char *imageId, int64_t snapId); + ++int dplog(const int mod_id, const int log_level, const char *file_name, const int f_line, ++ const char *func_name, const int log_id, const char *format, ...); ++ +#ifdef __cplusplus +} +#endif @@ -1632,7 +1646,7 @@ index 2cb7fcee..59707481 100644 } diff --git a/src/common/options.cc b/src/common/options.cc -index 8135ea8f..9d3bb781 100644 +index 8135ea8f..dfda02a7 100644 --- a/src/common/options.cc +++ b/src/common/options.cc @@ -1015,7 +1015,7 @@ std::vector