diff options
author | Radoslaw Zarzynski <rzarzyns@redhat.com> | 2021-11-08 21:09:19 +0100 |
---|---|---|
committer | Radoslaw Zarzynski <rzarzyns@redhat.com> | 2022-01-12 21:35:50 +0100 |
commit | 1362134171bc902a98759eca879f584c6f89d2a3 (patch) | |
tree | 6ee75db0e2e4ad6fc718bd7d719b7878e17689b4 /src/blk/kernel | |
parent | blk: introduce multi-size huge page pools to KernelDevice. (diff) | |
download | ceph-1362134171bc902a98759eca879f584c6f89d2a3.tar.xz ceph-1362134171bc902a98759eca879f584c6f89d2a3.zip |
blk: don't cache the huge page-based buffers of KernelDevice.
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
Diffstat (limited to 'src/blk/kernel')
-rw-r--r-- | src/blk/kernel/KernelDevice.cc | 8 | ||||
-rw-r--r-- | src/blk/kernel/KernelDevice.h | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/blk/kernel/KernelDevice.cc b/src/blk/kernel/KernelDevice.cc index 62f91fa7bc8..7a0d90b449c 100644 --- a/src/blk/kernel/KernelDevice.cc +++ b/src/blk/kernel/KernelDevice.cc @@ -1170,7 +1170,8 @@ HugePagePoolOfPools HugePagePoolOfPools::from_desc(const std::string& desc) { // create a buffer basing on user-configurable. it's intended to make // our buffers THP-able. ceph::unique_leakable_ptr<buffer::raw> KernelDevice::create_custom_aligned( - const size_t len) const + const size_t len, + IOContext* const ioc) const { // just to preserve the logic of create_small_page_aligned(). if (len < CEPH_PAGE_SIZE) { @@ -1185,6 +1186,7 @@ ceph::unique_leakable_ptr<buffer::raw> KernelDevice::create_custom_aligned( << " bdev_read_preallocated_huge_buffers=" << cct->_conf.get_val<std::string>("bdev_read_preallocated_huge_buffers") << dendl; + ioc->flags |= IOContext::FLAG_DONT_CACHE; return lucky_raw; } else { // fallthrough due to empty buffer pool. this can happen also @@ -1214,7 +1216,7 @@ int KernelDevice::read(uint64_t off, uint64_t len, bufferlist *pbl, auto start1 = mono_clock::now(); - auto p = ceph::buffer::ptr_node::create(create_custom_aligned(len)); + auto p = ceph::buffer::ptr_node::create(create_custom_aligned(len, ioc)); int r = ::pread(choose_fd(buffered, WRITE_LIFE_NOT_SET), p->c_str(), len, off); auto age = cct->_conf->bdev_debug_aio_log_age; @@ -1266,7 +1268,7 @@ int KernelDevice::aio_read( ++ioc->num_pending; aio_t& aio = ioc->pending_aios.back(); aio.bl.push_back( - ceph::buffer::ptr_node::create(create_custom_aligned(len))); + ceph::buffer::ptr_node::create(create_custom_aligned(len, ioc))); aio.bl.prepare_iov(&aio.iov); aio.preadv(off, len); dout(30) << aio << dendl; diff --git a/src/blk/kernel/KernelDevice.h b/src/blk/kernel/KernelDevice.h index 14d9a470117..613a9bbfed9 100644 --- a/src/blk/kernel/KernelDevice.h +++ b/src/blk/kernel/KernelDevice.h @@ -112,7 +112,7 @@ private: void _detect_vdo(); int choose_fd(bool buffered, int write_hint) const; - ceph::unique_leakable_ptr<buffer::raw> create_custom_aligned(size_t len) const; + ceph::unique_leakable_ptr<buffer::raw> create_custom_aligned(size_t len, IOContext* ioc) const; public: KernelDevice(CephContext* cct, aio_callback_t cb, void *cbpriv, aio_callback_t d_cb, void *d_cbpriv); |