From: Alexander Turenko <alexander.turenko@tarantool.org>
To: Vladimir Davydov <vdavydov.dev@gmail.com>
Cc: Cyrill Gorcunov <gorcunov@gmail.com>,
tml <tarantool-patches@freelists.org>
Subject: Re: [PATCH 2/3] slab_arena: Provide slab_arena_madvise_create to madvice slabs
Date: Mon, 6 May 2019 16:46:59 +0300 [thread overview]
Message-ID: <20190506134659.2e7ancyjjz7k6pyh@tkn_work_nb> (raw)
In-Reply-To: <20190506103836.gxvrre4upkga7tej@esperanza>
> > +#ifdef TARANTOOL_SMALL_HAS_MADVISE
> > +/**
> > + * slab_arena_madvise_create - Initialize madvise permanent strategy
> > + * @arena: slab arena to madvise
> > + * @advice: strategy (MADV_DONTDUMP, ...)
> > + *
> > + * This function setups @slab_arena strategy so that new memory
> > + * allocation with mmap() call gets madvise() call with @advice.
> > + *
> > + * Note that we don't allow to change strategy once choosen because
> > + * otherwise we need to walk over all possible slab cache entry.
> > + *
> > + * This function should be called right after the slab arena creation,
> > + * otherwise if called later some of the non-preallocated slabs won't be
> > + * madvise'd.
> > + */
> > +int
> > +slab_arena_madvise_create(struct slab_arena *arena, int advice)
>
> I don't see much point in changing madvise settings on the fly.
> Let's instead allow to pass DONTDUMP flag at creation time.
> This means we have to combine MAP_ and MADV_ flags. I guess it
> was a bad idea to pass MAP_ flags directly to small_create() in
> the first place. What about introducing small-specific flags like
>
> SLAB_ARENA_SHARED
> SLAB_ARENA_DONTDUMP
>
> Come to think of it, I assume we don't even need to introduce
> SLAB_ARENA_SHARED - we always pass MAP_PRIVATE to small_create().
> Let's drop it, perhaps?
>
> It will break backward compatibility, but I don't think it really
> matters, as tarantool/small is only used by tarantool - it isn't
> a big deal if we change its API. We only need to bump the version
> number, I guess.
>
> Alexander, please amend me if I'm wrong.
I don't know other users of the library, so incompatiable changes looks
okay.
I would release a new version (an annotated tag + a github release) and
mention incompatible changes to let potential users know about this.
Maybe this is too formal, don't know :)
WBR, Alexander Turenko.
next prev parent reply other threads:[~2019-05-06 13:46 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-01 15:50 [PATCH 0/3] small: Prepare ground for madvise Cyrill Gorcunov
2019-05-01 15:50 ` [PATCH 1/3] build: Check for madvise syscall Cyrill Gorcunov
2019-05-06 10:25 ` Vladimir Davydov
2019-05-06 10:39 ` Cyrill Gorcunov
2019-05-01 15:50 ` [PATCH 2/3] slab_arena: Provide slab_arena_madvise_create to madvice slabs Cyrill Gorcunov
2019-05-06 10:38 ` Vladimir Davydov
2019-05-06 11:03 ` Cyrill Gorcunov
2019-05-06 13:46 ` Alexander Turenko [this message]
2019-05-01 15:50 ` [PATCH 3/3] test: slab_arena -- Verify madvise Cyrill Gorcunov
2019-05-06 10:45 ` Vladimir Davydov
2019-05-06 10:48 ` Cyrill Gorcunov
2019-05-06 10:55 ` Vladimir Davydov
2019-05-06 10:57 ` Cyrill Gorcunov
2019-05-06 11:04 ` Alexander Turenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190506134659.2e7ancyjjz7k6pyh@tkn_work_nb \
--to=alexander.turenko@tarantool.org \
--cc=gorcunov@gmail.com \
--cc=tarantool-patches@freelists.org \
--cc=vdavydov.dev@gmail.com \
--subject='Re: [PATCH 2/3] slab_arena: Provide slab_arena_madvise_create to madvice slabs' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox