[RFC v2] slab_arena: Enhance slab_arena_create to support madvise hints

Vladimir Davydov vdavydov.dev at gmail.com
Mon May 13 14:56:43 MSK 2019


On Mon, May 13, 2019 at 02:41:31PM +0300, Cyrill Gorcunov wrote:
> On Mon, May 13, 2019 at 02:21:56PM +0300, Vladimir Davydov wrote:
> > On Mon, May 13, 2019 at 01:30:32PM +0300, Cyrill Gorcunov wrote:
> > > > > +check_symbol_exists(MADV_NORMAL sys/mman.h TARANTOOL_SMALL_HAS_MADV_NORMAL)
> > > > > +check_symbol_exists(MADV_DONTDUMP sys/mman.h TARANTOOL_SMALL_HAS_MADV_DONTDUMP)
> > > > 
> > > > Do we really need to check all of that? Is a check for MADV_DONTDUMP not
> > > > enough?
> > > 
> > > Well, strictly speaking we should check each definition we use, because I'm
> > > not sure if MADV_NORMAL defined on other than linux environments.
> > 
> > Why do we use MADV_NORMAL, anyway? We only need MADV_DONTDUMP or
> > am I missing something?
> 
> Because we need a default value, which would be different
> from MADV_DONTDUMP. Actually MADV_NORMAL = 0 in linux and

If SLAB_DONTDUMP isn't set, we don't need to call madvise at all, do we?

> I think we may even live without this member initialized

If we store SLAB_* flags in slab_arena instead of map_flags + madv_flags
we won't be facing this problem, will we?

> but for code readability sake I assign mode to MADV_NORMAL
> by default.



More information about the Tarantool-patches mailing list