Merge pull request #283 from rafalste/fix_nhit_param_value
Accept max values of nhit PP as valid.
This commit is contained in:
commit
07aa29fc56
@ -72,7 +72,7 @@ ocf_error_t nhit_set_param(ocf_promotion_policy_t policy, uint8_t param_id,
|
|||||||
switch (param_id) {
|
switch (param_id) {
|
||||||
case ocf_nhit_insertion_threshold:
|
case ocf_nhit_insertion_threshold:
|
||||||
if (param_value >= OCF_NHIT_MIN_THRESHOLD &&
|
if (param_value >= OCF_NHIT_MIN_THRESHOLD &&
|
||||||
param_value < OCF_NHIT_MAX_THRESHOLD) {
|
param_value <= OCF_NHIT_MAX_THRESHOLD) {
|
||||||
env_atomic_set(&ctx->insertion_threshold, param_value);
|
env_atomic_set(&ctx->insertion_threshold, param_value);
|
||||||
} else {
|
} else {
|
||||||
ocf_cache_log(policy->owner, log_err, "Invalid nhit "
|
ocf_cache_log(policy->owner, log_err, "Invalid nhit "
|
||||||
@ -83,7 +83,7 @@ ocf_error_t nhit_set_param(ocf_promotion_policy_t policy, uint8_t param_id,
|
|||||||
|
|
||||||
case ocf_nhit_trigger_threshold:
|
case ocf_nhit_trigger_threshold:
|
||||||
if (param_value >= OCF_NHIT_MIN_TRIGGER &&
|
if (param_value >= OCF_NHIT_MIN_TRIGGER &&
|
||||||
param_value < OCF_NHIT_MAX_TRIGGER) {
|
param_value <= OCF_NHIT_MAX_TRIGGER) {
|
||||||
env_atomic64_set(&ctx->trigger_threshold,
|
env_atomic64_set(&ctx->trigger_threshold,
|
||||||
OCF_DIV_ROUND_UP((param_value *
|
OCF_DIV_ROUND_UP((param_value *
|
||||||
ocf_metadata_get_cachelines_count(policy->owner)),
|
ocf_metadata_get_cachelines_count(policy->owner)),
|
||||||
|
Loading…
Reference in New Issue
Block a user