From: Sage Weil Date: Thu, 29 Jun 2017 14:32:20 +0000 (-0400) Subject: os/bluestore/BlueFS: clean up log_writer aios from compaction X-Git-Tag: v12.1.1~109^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=727aef4db8e9fb0ca41d0b72118aefa5df9ff436;p=ceph.git os/bluestore/BlueFS: clean up log_writer aios from compaction Normally any time we wait for aios and flush the device we go through _flush_bdev_safely(), which takes the completed aios off of the IOContext and discards them, releasing memory. However, compaction does not use that method because it does not (currently) drop the lock while doing the flush, which means we slowly leak memory after each internal log compaction. Fix by explicitly releasing these aios, similar to _flush_bdev_safely(). Fixes: http://tracker.ceph.com/issues/20454 Signed-off-by: Sage Weil --- diff --git a/src/os/bluestore/BlueFS.cc b/src/os/bluestore/BlueFS.cc index f73e27cf6030..883dbf94410a 100644 --- a/src/os/bluestore/BlueFS.cc +++ b/src/os/bluestore/BlueFS.cc @@ -1138,6 +1138,11 @@ void BlueFS::_compact_log_sync() assert(r == 0); wait_for_aio(log_writer); + list completed_ios; + _claim_completed_aios(log_writer, &completed_ios); + flush_bdev(); + completed_ios.clear(); + dout(10) << __func__ << " writing super" << dendl; super.log_fnode = log_file->fnode; ++super.version; @@ -1238,7 +1243,11 @@ void BlueFS::_compact_log_async(std::unique_lock& l) // 4. wait dout(10) << __func__ << " waiting for compacted log to sync" << dendl; wait_for_aio(new_log_writer); + + list completed_ios; + _claim_completed_aios(new_log_writer, &completed_ios); flush_bdev(); + completed_ios.clear(); // 5. retake lock lock.lock();