mirror of
https://github.com/ceph/ceph
synced 2026-08-02 07:03:18 +00:00
crimson/os/alienstore: configure Seastar's memory allocator.
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
This commit is contained in:
parent
0ad46affde
commit
f7715b86ef
@ -5,6 +5,7 @@
|
||||
#include "alien_store.h"
|
||||
|
||||
#include <map>
|
||||
#include <optional>
|
||||
#include <string_view>
|
||||
#include <boost/algorithm/string/trim.hpp>
|
||||
#include <fmt/format.h>
|
||||
@ -12,7 +13,9 @@
|
||||
|
||||
#include <seastar/core/alien.hh>
|
||||
#include <seastar/core/future-util.hh>
|
||||
#include <seastar/core/memory.hh>
|
||||
#include <seastar/core/reactor.hh>
|
||||
#include <seastar/core/resource.hh>
|
||||
|
||||
#include "common/ceph_context.h"
|
||||
#include "global/global_context.h"
|
||||
@ -524,4 +527,13 @@ int AlienStore::AlienOmapIterator::status() const
|
||||
return iter->status();
|
||||
}
|
||||
|
||||
void AlienStore::configure_thread_memory()
|
||||
{
|
||||
std::vector<seastar::resource::memory> layout;
|
||||
// 1 GiB for experimenting. Perhaps we'll introduce a config option later.
|
||||
// TODO: consider above.
|
||||
layout.emplace_back(seastar::resource::memory{1024 * 1024 * 1024, 0});
|
||||
seastar::memory::configure(layout, false, std::nullopt);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -111,6 +111,8 @@ public:
|
||||
seastar::future<FuturizedStore::OmapIteratorRef> get_omap_iterator(
|
||||
CollectionRef ch,
|
||||
const ghobject_t& oid) final;
|
||||
|
||||
static void configure_thread_memory();
|
||||
private:
|
||||
constexpr static unsigned MAX_KEYS_PER_OMAP_GET_CALL = 32;
|
||||
const std::string path;
|
||||
|
||||
@ -2,10 +2,10 @@
|
||||
|
||||
#include <chrono>
|
||||
#include <pthread.h>
|
||||
#include "include/intarith.h"
|
||||
|
||||
#include "include/ceph_assert.h"
|
||||
#include "crimson/common/config_proxy.h"
|
||||
#include "crimson/os/alienstore/alien_store.h"
|
||||
|
||||
using crimson::common::local_conf;
|
||||
|
||||
@ -21,6 +21,7 @@ ThreadPool::ThreadPool(size_t n_threads,
|
||||
for (size_t i = 0; i < n_threads; i++) {
|
||||
threads.emplace_back([this, cpu_id, queue_max_wait] {
|
||||
pin(cpu_id);
|
||||
crimson::os::AlienStore::configure_thread_memory();
|
||||
loop(queue_max_wait);
|
||||
});
|
||||
}
|
||||
|
||||
@ -35,9 +35,9 @@ add_executable(unittest_seastar_alienstore_thread_pool
|
||||
add_ceph_test(unittest_seastar_alienstore_thread_pool
|
||||
unittest_seastar_alienstore_thread_pool --memory 256M --smp 1)
|
||||
target_link_libraries(unittest_seastar_alienstore_thread_pool
|
||||
crimson
|
||||
crimson-os
|
||||
crimson-common)
|
||||
crimson-alienstore
|
||||
crimson)
|
||||
|
||||
add_executable(unittest_seastar_config
|
||||
test_config.cc)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user