[PATCH v2 09/11] vinyl: do not account zero dump bandwidth

Vladimir Davydov vdavydov.dev at gmail.com
Fri Sep 28 20:40:07 MSK 2018


Since we free memory in 16 MB blocks (see SLAB_SIZE), it may occur that
we dump almost all data stored in a block but still have to leave it be,
because it contains data of a newer generation. If the memory limit is
small (as it is typically in tests), this may result in dumping 0 bytes.
In order not to disrupt statistics and throttling transactions in vain,
let's simply ignore such results. Normally, the memory limit should be
large enough for such granularity not to affect the measurements
(hundreds of megabytes) so this problem isn't worth putting more efforts
into.

Needed for #1862
---
 src/box/vy_regulator.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/src/box/vy_regulator.c b/src/box/vy_regulator.c
index 5ec5629f..682777fc 100644
--- a/src/box/vy_regulator.c
+++ b/src/box/vy_regulator.c
@@ -200,7 +200,20 @@ vy_regulator_dump_complete(struct vy_regulator *regulator,
 {
 	regulator->dump_in_progress = false;
 
-	if (dump_duration > 0) {
+	/*
+	 * Update dump bandwidth.
+	 *
+	 * Note, since we free memory in 16 MB blocks (see SLAB_SIZE),
+	 * it may occur that we dump almost all data stored in a block
+	 * but still have to leave it be, because it contains data of
+	 * a newer generation. If the memory limit is small, this may
+	 * result in dumping 0 bytes. In order not to disrupt statistics
+	 * let's simply ignore such results. Normally, the memory limit
+	 * should be large enough for such granularity not to affect the
+	 * measurements (hundreds of megabytes) so this problem isn't
+	 * worth putting more efforts into.
+	 */
+	if (mem_dumped > 0 && dump_duration > 0) {
 		histogram_collect(regulator->dump_bw_hist,
 				  mem_dumped / dump_duration);
 		/*
-- 
2.11.0




More information about the Tarantool-patches mailing list