mirror of
https://github.com/ceph/ceph
synced 2025-02-22 10:37:15 +00:00
Merge pull request #38602 from dillaman/wip-48486
librbd: explicitly disable readahead for writearound cache Reviewed-by: Mykola Golub <mgolub@suse.com>
This commit is contained in:
commit
e73c0970a1
@ -769,8 +769,6 @@ librados::IoCtx duplicate_io_ctx(librados::IoCtx& io_ctx) {
|
||||
ASSIGN_OPTION(non_blocking_aio, bool);
|
||||
ASSIGN_OPTION(cache, bool);
|
||||
ASSIGN_OPTION(sparse_read_threshold_bytes, Option::size_t);
|
||||
ASSIGN_OPTION(readahead_max_bytes, Option::size_t);
|
||||
ASSIGN_OPTION(readahead_disable_after_bytes, Option::size_t);
|
||||
ASSIGN_OPTION(clone_copy_on_read, bool);
|
||||
ASSIGN_OPTION(enable_alloc_hint, bool);
|
||||
ASSIGN_OPTION(mirroring_replay_delay, uint64_t);
|
||||
@ -780,6 +778,12 @@ librados::IoCtx duplicate_io_ctx(librados::IoCtx& io_ctx) {
|
||||
ASSIGN_OPTION(discard_granularity_bytes, uint64_t);
|
||||
ASSIGN_OPTION(blkin_trace_all, bool);
|
||||
|
||||
auto cache_policy = config.get_val<std::string>("rbd_cache_policy");
|
||||
if (cache_policy == "writethrough" || cache_policy == "writeback") {
|
||||
ASSIGN_OPTION(readahead_max_bytes, Option::size_t);
|
||||
ASSIGN_OPTION(readahead_disable_after_bytes, Option::size_t);
|
||||
}
|
||||
|
||||
#undef ASSIGN_OPTION
|
||||
|
||||
if (sparse_read_threshold_bytes == 0) {
|
||||
|
@ -214,8 +214,8 @@ namespace librbd {
|
||||
bool non_blocking_aio;
|
||||
bool cache;
|
||||
uint64_t sparse_read_threshold_bytes;
|
||||
uint64_t readahead_max_bytes;
|
||||
uint64_t readahead_disable_after_bytes;
|
||||
uint64_t readahead_max_bytes = 0;
|
||||
uint64_t readahead_disable_after_bytes = 0;
|
||||
bool clone_copy_on_read;
|
||||
bool enable_alloc_hint;
|
||||
uint32_t alloc_hint_flags = 0U;
|
||||
|
@ -576,6 +576,8 @@ Context *OpenRequest<I>::send_init_cache(int *result) {
|
||||
auto cache = cache::WriteAroundObjectDispatch<I>::create(
|
||||
m_image_ctx, max_dirty, writethrough_until_flush);
|
||||
cache->init();
|
||||
|
||||
m_image_ctx->readahead.set_max_readahead_size(0);
|
||||
} else if (cache_policy == "writethrough" || cache_policy == "writeback") {
|
||||
if (cache_policy == "writethrough") {
|
||||
max_dirty = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user