Skip to content

Commit

Permalink
Merge pull request ceph#40493 from CongMinYin/fix-rwl-fragment
Browse files Browse the repository at this point in the history
librbd/cache/pwl: Fix pmem cache fragment issue

Reviewed-by: Mykola Golub <[email protected]>
Reviewed-by: Ilya Dryomov <[email protected]>
  • Loading branch information
idryomov authored Apr 29, 2021
2 parents e216c1e + b53392a commit defea70
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmake/modules/Buildpmem.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions make-dist
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
6 changes: 6 additions & 0 deletions src/librbd/cache/pwl/rwl/WriteLog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit defea70

Please sign in to comment.