Merge pull request #40493 from CongMinYin/fix-rwl-fragment

librbd/cache/pwl: Fix pmem cache fragment issue

Reviewed-by: Mykola Golub <mgolub@suse.com>
Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
This commit is contained in:
Ilya Dryomov 2021-04-29 09:35:21 +02:00 committed by GitHub
commit defea709f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 4 deletions

View File

@ -9,7 +9,7 @@ function(build_pmem)
set(source_dir_args
SOURCE_DIR ${CMAKE_BINARY_DIR}/src/pmdk
GIT_REPOSITORY https://github.com/ceph/pmdk.git
GIT_TAG "1.7"
GIT_TAG "1.10"
GIT_SHALLOW TRUE
GIT_CONFIG advice.detachedHead=false)
endif()

View File

@ -186,8 +186,8 @@ download_boost $boost_version 953db31e016db7bb207f11432bef7df100516eeb746843fa04
download_liburing 0.7 8e2842cfe947f3a443af301bdd6d034455536c38a455c7a700d0c1ad165a7543 \
https://github.com/axboe/liburing/archive \
https://git.kernel.dk/cgit/liburing/snapshot
pmdk_version=1.7
download_pmdk $pmdk_version 865ce1b422bc83109cb4a63dcff8fd1077eea3617e668faf6a043208d8be03ca \
pmdk_version=1.10
download_pmdk $pmdk_version 08dafcf94db5ac13fac9139c92225d9aa5f3724ea74beee4e6ca19a01a2eb20c \
https://github.com/pmem/pmdk/releases/download/$pmdk_version
build_dashboard_frontend
generate_rook_ceph_client

View File

@ -534,7 +534,7 @@ if(WITH_BLUESTORE_PMEM OR WITH_RBD_RWL)
if(WITH_RBD_RWL)
list(APPEND pmem_COMPONENTS pmemobj)
endif()
find_package(pmem 1.7 REQUIRED COMPONENTS ${pmem_COMPONENTS})
find_package(pmem 1.10 REQUIRED COMPONENTS ${pmem_COMPONENTS})
else()
include(Buildpmem)
build_pmem()

View File

@ -897,6 +897,12 @@ void WriteLog<I>::reserve_cache(C_BlockIORequestT *req,
<< *req << dendl;
alloc_succeeds = false;
no_space = true; /* Entries need to be retired */
if (this->m_free_log_entries == this->m_total_log_entries - 1) {
/* When the cache is empty, there is still no space to allocate.
* Defragment. */
pmemobj_defrag(m_log_pool, NULL, 0, NULL);
}
break;
} else {
buffer.allocated = true;