From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng2.m.smailru.net (smtpng2.m.smailru.net [94.100.179.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id AEDC546970E for ; Mon, 10 Feb 2020 14:52:43 +0300 (MSK) Date: Mon, 10 Feb 2020 14:52:41 +0300 From: Nikita Pettik Message-ID: <20200210115241.GE1110@tarantool.org> References: <6c6d81d1-d9d2-5248-3edd-f56aefea9e76@tarantool.org> <20200207135859.GA51051@tarantool.org> <218075cd-d38d-1134-efab-6c713e34cef4@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <218075cd-d38d-1134-efab-6c713e34cef4@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH] region: do not rotate slabs in case of single slab purification List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladislav Shpilevoy Cc: tarantool-patches@dev.tarantool.org On 08 Feb 01:28, Vladislav Shpilevoy wrote: > Hi! Thanks for the explanation! > > On 07/02/2020 14:58, Nikita Pettik wrote: > > ... > > region alloc size 1 > > current slab unused 1978 > > current slab used 2062 > > current slab size 4096 > > region alloc size 1 > > current slab unused 1977 > > current slab used 2063 > > current slab size 4096 > > fiber_gc > > fiber reset //at this step total memory is 26730 - 2063 = 24667 > > > > At the end of execution fibre_gc() is called, which in turn will nullify > > slab->used memory consuption and ergo reduce whole fiber.memory.used > > consumption by 2063. That's why amount of memory in usage at the end of > > query execution does not match with initial value. > > > > Now, if truncate didn't rotate slab, region memory before and after > > query execution would be the same. So, it would make tests like this > > more stable, since region leaks could be easily detected as difference > > between initial (i.e. before query execution) and final > > (i.e. after execution) occupied region memory. > > Aha, now I see. region_reset() does not nullify all the > slabs. I missed that the revert is already pushed. Yes, then > looks fine. Except that if a request uses more than 128Kb, then > it will call region_free() in fiber_gc() and will reduce memory > consumption anyway. But for small tests may help. > > The patch LGTM. Fixed a few typos in commit message and re-pushed. Patch received 2 LGTMs; Alexander Tikhonov reported that there's no performance degradations (as well as significant gains) according to sysbench.