]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
commom/buffer: use small page aligned when bufferlist prealloc memory 38701/head
authorluo rixin <luorixin@huawei.com>
Wed, 23 Dec 2020 09:02:51 +0000 (17:02 +0800)
committerluo rixin <luorixin@huawei.com>
Wed, 23 Dec 2020 09:38:09 +0000 (17:38 +0800)
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 <luorixin@huawei.com>
src/common/buffer.cc

index d9b32163dbab59184eff8c5a6b130397f8f83574..8d7583e7adb06ee110f6a0dc944bf72e0b027f75 100644 (file)
@@ -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());