Skip to content
Snippets Groups Projects
Commit d51f3f8f authored by Konstantin Osipov's avatar Konstantin Osipov
Browse files

Merge remote-tracking branch 'origin/snapshot-crash' into 1.6

parents c7c00c61 4adced63
No related branches found
No related tags found
No related merge requests found
......@@ -58,7 +58,7 @@
*/
extern struct quota memtx_quota;
static bool memtx_index_arena_initialized = false;
static struct slab_arena memtx_index_arena;
extern struct slab_arena memtx_arena;
static struct slab_cache memtx_index_slab_cache;
struct mempool memtx_index_extent_pool;
/**
......@@ -897,13 +897,8 @@ memtx_index_arena_init()
/* already done.. */
return;
}
/* Creating arena */
if (slab_arena_create(&memtx_index_arena, &memtx_quota,
0, MEMTX_SLAB_SIZE, MAP_PRIVATE)) {
panic_syserror("failed to initialize index arena");
}
/* Creating slab cache */
slab_cache_create(&memtx_index_slab_cache, &memtx_index_arena);
slab_cache_create(&memtx_index_slab_cache, &memtx_arena);
/* Creating mempool */
mempool_create(&memtx_index_extent_pool,
&memtx_index_slab_cache,
......
......@@ -606,19 +606,10 @@ tuple_init(float tuple_arena_max_size, uint32_t objsize_min,
size_t prealloc = tuple_arena_max_size * 1024 * 1024 * 1024;
quota_init(&memtx_quota, prealloc);
int flags;
if (access("/proc/user_beancounters", F_OK) == 0) {
say_warn("disable shared arena since running under OpenVZ "
"(https://bugzilla.openvz.org/show_bug.cgi?id=2805)");
flags = MAP_PRIVATE;
} else {
say_info("mapping %zu bytes for a shared arena...",
prealloc);
flags = MAP_SHARED;
}
say_info("mapping %zu bytes for tuple arena...", prealloc);
if (slab_arena_create(&memtx_arena, &memtx_quota,
prealloc, slab_size, flags)) {
prealloc, slab_size, MAP_PRIVATE)) {
if (ENOMEM == errno) {
panic("failed to preallocate %zu bytes: "
"Cannot allocate memory, check option "
......
......@@ -152,9 +152,7 @@ small_alloc_setopt(struct small_alloc *alloc, enum small_opt opt, bool val)
{
switch (opt) {
case SMALL_DELAYED_FREE_MODE:
/* Delayed mode is only usable if the arena is shared. */
if (alloc->cache->arena->flags & MAP_SHARED)
alloc->is_delayed_free_mode = val;
alloc->is_delayed_free_mode = val;
break;
default:
assert(false);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment