From 9089aad33a8738ed6c0022d4053f193c68209f2b Mon Sep 17 00:00:00 2001 From: luo rixin Date: Wed, 23 Dec 2020 17:02:51 +0800 Subject: [PATCH] commom/buffer: use small page aligned when bufferlist prealloc memory On aarch64, when set pagesize to 64K, the memory is over used and the cache memory always be over evicted. It is caused by BlueStore ExtentMap which need to reserve 256B(the config option is bluestore_extent_map_inline_shard_prealloc_size). When bufferlist using page aligned way to prealloc small size memory from tcmalloc, tcmalloc will allocate a page and can not reuse the unused memory in this page. The more bluestore_onode items in meta cache, there are more wasted memory in an OSD daemon. Signed-off-by: luo rixin --- src/common/buffer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/buffer.cc b/src/common/buffer.cc index d9b32163dbab5..8d7583e7adb06 100644 --- a/src/common/buffer.cc +++ b/src/common/buffer.cc @@ -1269,7 +1269,7 @@ static ceph::spinlock debug_lock; void buffer::list::reserve(size_t prealloc) { if (get_append_buffer_unused_tail_length() < prealloc) { - auto ptr = ptr_node::create(buffer::create_page_aligned(prealloc)); + auto ptr = ptr_node::create(buffer::create_small_page_aligned(prealloc)); ptr->set_length(0); // unused, so far. _carriage = ptr.get(); _buffers.push_back(*ptr.release()); -- 2.39.5