[Tarantool-patches] [PATCH] region: do not rotate slabs in case of single slab purification

Nikita Pettik korablev at tarantool.org
Mon Feb 10 14:52:41 MSK 2020


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.



More information about the Tarantool-patches mailing list