diff --git a/src/box/vinyl.c b/src/box/vinyl.c index 970fff5bfeb1e86b4d5a8bbba095c3350535369e..c2b7eb78f2df7c4c6b6dc8cd0e92c4d96b66af0e 100644 --- a/src/box/vinyl.c +++ b/src/box/vinyl.c @@ -2663,7 +2663,7 @@ vinyl_engine_set_memory(struct vinyl_engine *vinyl, size_t size) "cannot decrease memory size at runtime"); return -1; } - vy_quota_set_limit(&vinyl->env->quota, size); + vy_regulator_set_memory_limit(&vinyl->env->regulator, size); return 0; } diff --git a/src/box/vy_regulator.c b/src/box/vy_regulator.c index d3fc1a4a9047009562011aacb080b0338cedbcca..eebfe8057cdb8354c9656bdbf8c42fbeba8336da 100644 --- a/src/box/vy_regulator.c +++ b/src/box/vy_regulator.c @@ -267,6 +267,13 @@ vy_regulator_dump_complete(struct vy_regulator *regulator, regulator->dump_bandwidth); } +void +vy_regulator_set_memory_limit(struct vy_regulator *regulator, size_t limit) +{ + vy_quota_set_limit(regulator->quota, limit); + vy_regulator_update_dump_watermark(regulator); +} + void vy_regulator_reset_dump_bandwidth(struct vy_regulator *regulator, size_t max) { diff --git a/src/box/vy_regulator.h b/src/box/vy_regulator.h index 341f41df45af4c6dc3ce0c8d1273fe5db2c26a2d..65c1672d27ebcbb0d4067a06e2100ff4b9f80371 100644 --- a/src/box/vy_regulator.h +++ b/src/box/vy_regulator.h @@ -151,6 +151,12 @@ void vy_regulator_dump_complete(struct vy_regulator *regulator, size_t mem_dumped, double dump_duration); +/** + * Set memory limit and update the dump watermark accordingly. + */ +void +vy_regulator_set_memory_limit(struct vy_regulator *regulator, size_t limit); + /** * Reset dump bandwidth histogram and update initial estimate. * Called when box.cfg.snap_io_rate_limit is updated.