We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 448c310 commit 1b66487Copy full SHA for 1b66487
src/cleaning/alru.c
@@ -879,9 +879,16 @@ static bool check_for_dirty_ratio(ocf_cache_t cache,
879
return false;
880
881
ctx = cache->cleaner.cleaning_policy_context;
882
- threshold = ctx->dirty_ratio_triggered
883
- ? config->dirty_ratio_threshold - config->dirty_ratio_inertia
884
- : config->dirty_ratio_threshold;
+ if (ctx->dirty_ratio_triggered) {
+ if (config->dirty_ratio_inertia
+ >= config->dirty_ratio_threshold)
885
+ return true;
886
+
887
+ threshold = config->dirty_ratio_threshold
888
+ - config->dirty_ratio_inertia;
889
+ } else {
890
+ threshold = config->dirty_ratio_threshold;
891
+ }
892
893
ctx->dirty_ratio_triggered = info.dirty * 100 / info.size >= threshold;
894
return ctx->dirty_ratio_triggered;
0 commit comments