From 2097f8029b97a637594de9e3a941011f67913da3 Mon Sep 17 00:00:00 2001 From: Rafal Stefanowski Date: Tue, 9 Nov 2021 13:41:49 +0100 Subject: [PATCH] Set promote_on_threshold sequential cutoff flag Due to linux thread scheduling nature, we prefer to promote streams as early as we reasonably can. One way to achieve that is to set promotion count really low, which unfortunately significantly increases number of accesses to shared structures. The other way is to promote streams which reach cutoff threshold, as we can reasonably assume that they are likely be continued after thread is rescheduled to another CPU. Signed-off-by: Rafal Stefanowski --- modules/cas_cache/layer_cache_management.c | 9 +++++++++ ocf | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/modules/cas_cache/layer_cache_management.c b/modules/cas_cache/layer_cache_management.c index 6a385b1..8fb4474 100644 --- a/modules/cas_cache/layer_cache_management.c +++ b/modules/cas_cache/layer_cache_management.c @@ -1346,6 +1346,15 @@ int cache_mngt_add_core_to_cache(const char *cache_name, size_t name_len, cfg->seq_cutoff_threshold = seq_cut_off_mb * MiB; cfg->seq_cutoff_promotion_count = 8; + /* Due to linux thread scheduling nature, we prefer to promote streams + * as early as we reasonably can. One way to achieve that is to set + * promotion count really low, which unfortunately significantly increases + * number of accesses to shared structures. The other way is to promote + * streams which reach cutoff threshold, as we can reasonably assume that + * they are likely be continued after thread is rescheduled to another CPU. + */ + cfg->seq_cutoff_promote_on_threshold = true; + init_completion(&add_context.cmpl); add_context.core = &core; add_context.result = &result; diff --git a/ocf b/ocf index 12c8b4e..f6e337a 160000 --- a/ocf +++ b/ocf @@ -1 +1 @@ -Subproject commit 12c8b4e333d7472f55f277195418db3df8ba6e2d +Subproject commit f6e337ac79f0f016ee053b1fc6caf44abeb9cbf8