@@ -363,7 +363,7 @@ void cleaning_policy_alru_setup(struct ocf_cache *cache)
363363 config -> stale_buffer_time = OCF_ALRU_DEFAULT_STALENESS_TIME ;
364364 config -> flush_max_buffers = OCF_ALRU_DEFAULT_FLUSH_MAX_BUFFERS ;
365365 config -> activity_threshold = OCF_ALRU_DEFAULT_ACTIVITY_THRESHOLD ;
366- config -> max_dirty_ratio = OCF_ALRU_DEFAULT_MAX_DIRTY_RATIO ;
366+ config -> dirty_ratio_threshold = OCF_ALRU_DEFAULT_DIRTY_RATIO_THRESHOLD ;
367367 config -> dirty_ratio_inertia = OCF_ALRU_DEFAULT_DIRTY_RATIO_INERTIA ;
368368}
369369
@@ -632,15 +632,15 @@ int cleaning_policy_alru_set_cleaning_param(ocf_cache_t cache,
632632 "activity time threshold: %d\n" ,
633633 config -> activity_threshold );
634634 break ;
635- case ocf_alru_max_dirty_ratio :
635+ case ocf_alru_dirty_ratio_threshold :
636636 OCF_CLEANING_CHECK_PARAM (cache , param_value ,
637- OCF_ALRU_MIN_MAX_DIRTY_RATIO ,
638- OCF_ALRU_MAX_MAX_DIRTY_RATIO ,
639- "max_dirty_ratio " );
640- config -> max_dirty_ratio = param_value ;
637+ OCF_ALRU_MIN_DIRTY_RATIO_THRESHOLD ,
638+ OCF_ALRU_MAX_DIRTY_RATIO_THRESHOLD ,
639+ "dirty_ratio_threshold " );
640+ config -> dirty_ratio_threshold = param_value ;
641641 ocf_cache_log (cache , log_info , "Write-back flush thread "
642- "max dirty ratio: %d\n" ,
643- config -> max_dirty_ratio );
642+ "dirty ratio trigger threshold : %d\n" ,
643+ config -> dirty_ratio_threshold );
644644 break ;
645645 default :
646646 return - OCF_ERR_INVAL ;
@@ -669,8 +669,8 @@ int cleaning_policy_alru_get_cleaning_param(ocf_cache_t cache,
669669 case ocf_alru_activity_threshold :
670670 * param_value = config -> activity_threshold ;
671671 break ;
672- case ocf_alru_max_dirty_ratio :
673- * param_value = config -> max_dirty_ratio ;
672+ case ocf_alru_dirty_ratio_threshold :
673+ * param_value = config -> dirty_ratio_threshold ;
674674 break ;
675675 default :
676676 return - OCF_ERR_INVAL ;
@@ -725,16 +725,16 @@ static bool check_for_dirty_ratio(ocf_cache_t cache,
725725 struct alru_context * ctx ;
726726 uint32_t threshold ;
727727
728- if (config -> max_dirty_ratio == OCF_ALRU_MAX_MAX_DIRTY_RATIO )
728+ if (config -> dirty_ratio_threshold == OCF_ALRU_MAX_DIRTY_RATIO_THRESHOLD )
729729 return false;
730730
731731 if (ocf_cache_get_info (cache , & info ))
732732 return false;
733733
734734 ctx = cache -> cleaner .cleaning_policy_context ;
735735 threshold = ctx -> dirty_ratio_triggered
736- ? config -> max_dirty_ratio - config -> dirty_ratio_inertia
737- : config -> max_dirty_ratio ;
736+ ? config -> dirty_ratio_threshold - config -> dirty_ratio_inertia
737+ : config -> dirty_ratio_threshold ;
738738
739739 ctx -> dirty_ratio_triggered = info .dirty * 100 / info .size >= threshold ;
740740 return ctx -> dirty_ratio_triggered ;
@@ -750,7 +750,7 @@ static bool is_cleanup_possible(ocf_cache_t cache, struct alru_flush_ctx *fctx)
750750 if (check_for_dirty_ratio (cache , config )) {
751751 fctx -> dirty_ratio_exceeded = true;
752752 OCF_DEBUG_PARAM (cache , "Dirty ratio exceeds: %u%%" ,
753- config -> max_dirty_ratio );
753+ config -> dirty_ratio_threshold );
754754 return true;
755755 }
756756
0 commit comments