From 4e160f20e44c4eca515f4b9e622a6ba26d0e5fd1 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 31 May 2017 18:44:02 -0400 Subject: [PATCH] os/bluestore: release aios and pinned buffers on io complete Once we're done with our IO, clear the aio list so that the pinned buffers are unpinned. This ensures we release memory quickly, even if the TransContext sticks around for a while (e.g., in the osr q). Signed-off-by: Sage Weil --- src/os/bluestore/BlueStore.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 56609a34138db..249fb05033072 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -7575,6 +7575,9 @@ void BlueStore::_txc_finish_io(TransContext *txc) std::lock_guard l(osr->qlock); txc->state = TransContext::STATE_IO_DONE; + // release aio contexts (including pinned buffers). + txc->ioc.running_aios.clear(); + OpSequencer::q_list_t::iterator p = osr->q.iterator_to(*txc); while (p != osr->q.begin()) { --p; -- 2.39.5