Lines Matching full:max

44     bkt->level = MAX(bkt->level - leak, 0);  in throttle_leak_bucket()
47 * keep track of bkt->burst_level so the bkt->max goal per second in throttle_leak_bucket()
50 leak = (bkt->max * (double) delta_ns) / NANOSECONDS_PER_SECOND; in throttle_leak_bucket()
51 bkt->burst_level = MAX(bkt->burst_level - leak, 0); in throttle_leak_bucket()
99 double burst_bucket_size; /* Before throttling to bkt->max */ in throttle_compute_wait()
105 if (!bkt->max) { in throttle_compute_wait()
106 /* If bkt->max is 0 we still want to allow short bursts of I/O in throttle_compute_wait()
114 bucket_size = bkt->max * bkt->burst_length; in throttle_compute_wait()
115 burst_bucket_size = (double) bkt->max / 10; in throttle_compute_wait()
127 assert(bkt->max > 0); /* see throttle_is_valid() */ in throttle_compute_wait()
130 return throttle_do_compute_wait(bkt->max, extra); in throttle_compute_wait()
330 bps_max_flag = cfg->buckets[THROTTLE_BPS_TOTAL].max && in throttle_is_valid()
331 (cfg->buckets[THROTTLE_BPS_READ].max || in throttle_is_valid()
332 cfg->buckets[THROTTLE_BPS_WRITE].max); in throttle_is_valid()
334 ops_max_flag = cfg->buckets[THROTTLE_OPS_TOTAL].max && in throttle_is_valid()
335 (cfg->buckets[THROTTLE_OPS_READ].max || in throttle_is_valid()
336 cfg->buckets[THROTTLE_OPS_WRITE].max); in throttle_is_valid()
339 error_setg(errp, "bps/iops/max total values and read/write values" in throttle_is_valid()
354 if (bkt->avg > THROTTLE_VALUE_MAX || bkt->max > THROTTLE_VALUE_MAX) { in throttle_is_valid()
355 error_setg(errp, "bps/iops/max values must be within [0, %lld]", in throttle_is_valid()
365 if (bkt->burst_length > 1 && !bkt->max) { in throttle_is_valid()
370 if (bkt->max && bkt->burst_length > THROTTLE_VALUE_MAX / bkt->max) { in throttle_is_valid()
375 if (bkt->max && !bkt->avg) { in throttle_is_valid()
381 if (bkt->max && bkt->max < bkt->avg) { in throttle_is_valid()
537 cfg->buckets[THROTTLE_BPS_TOTAL].max = arg->bps_total_max; in throttle_limits_to_config()
540 cfg->buckets[THROTTLE_BPS_READ].max = arg->bps_read_max; in throttle_limits_to_config()
543 cfg->buckets[THROTTLE_BPS_WRITE].max = arg->bps_write_max; in throttle_limits_to_config()
546 cfg->buckets[THROTTLE_OPS_TOTAL].max = arg->iops_total_max; in throttle_limits_to_config()
549 cfg->buckets[THROTTLE_OPS_READ].max = arg->iops_read_max; in throttle_limits_to_config()
552 cfg->buckets[THROTTLE_OPS_WRITE].max = arg->iops_write_max; in throttle_limits_to_config()
557 error_setg(errp, "bps-total-max-length value must be in" in throttle_limits_to_config()
565 error_setg(errp, "bps-read-max-length value must be in" in throttle_limits_to_config()
573 error_setg(errp, "bps-write-max-length value must be in" in throttle_limits_to_config()
581 error_setg(errp, "iops-total-max-length value must be in" in throttle_limits_to_config()
589 error_setg(errp, "iops-read-max-length value must be in" in throttle_limits_to_config()
597 error_setg(errp, "iops-write-max-length value must be in" in throttle_limits_to_config()
624 var->bps_total_max = cfg->buckets[THROTTLE_BPS_TOTAL].max; in throttle_config_to_limits()
625 var->bps_read_max = cfg->buckets[THROTTLE_BPS_READ].max; in throttle_config_to_limits()
626 var->bps_write_max = cfg->buckets[THROTTLE_BPS_WRITE].max; in throttle_config_to_limits()
627 var->iops_total_max = cfg->buckets[THROTTLE_OPS_TOTAL].max; in throttle_config_to_limits()
628 var->iops_read_max = cfg->buckets[THROTTLE_OPS_READ].max; in throttle_config_to_limits()
629 var->iops_write_max = cfg->buckets[THROTTLE_OPS_WRITE].max; in throttle_config_to_limits()