From 0f04bb1d6fc27c7fa5f6268d045c78bdc600ff65 Mon Sep 17 00:00:00 2001 From: Jason Evans Date: Tue, 3 Jan 2017 08:21:29 -0800 Subject: [PATCH] Rename the arenas.extend mallctl to arenas.create. --- doc/jemalloc.xml.in | 18 +++++++++--------- include/jemalloc/internal/arena.h | 6 +++--- src/ctl.c | 6 +++--- src/jemalloc.c | 2 +- test/integration/MALLOCX_ARENA.c | 4 ++-- test/integration/extent.c | 4 ++-- test/integration/xallocx.c | 2 +- test/unit/arena_reset.c | 2 +- test/unit/mallctl.c | 6 +++--- test/unit/pack.c | 8 ++++---- 10 files changed, 29 insertions(+), 29 deletions(-) diff --git a/doc/jemalloc.xml.in b/doc/jemalloc.xml.in index f6b50627..36aae37c 100644 --- a/doc/jemalloc.xml.in +++ b/doc/jemalloc.xml.in @@ -1457,8 +1457,8 @@ malloc_conf = "xmalloc:true";]]> -- Discard all of the arena's extant allocations. This - interface can only be used with arenas created via arenas.extend. None + interface can only be used with arenas explicitly created via arenas.create. None of the arena's discarded/cached allocations may accessed afterward. As part of this requirement, all thread caches which were used to allocate/deallocate in conjunction with the arena must be flushed @@ -1504,8 +1504,8 @@ malloc_conf = "xmalloc:true";]]> arena <i>. The functions must be capable of operating on all extant extents associated with arena <i>, usually by passing unknown extents to the replaced functions. In practice, it is feasible - to control allocation for arenas created via arenas.extend such + to control allocation for arenas explicitly created via arenas.create such that all extents originate from an application-supplied extent allocator (by specifying the custom extent hook functions during arena creation), but the automatically created arenas will have already created extents @@ -1836,15 +1836,15 @@ struct extent_hooks_s { class. - + - arenas.extend + arenas.create (unsigned, extent_hooks_t *) rw - Extend the array of arenas by appending a new arena with - optionally specified extent hooks, and returning the new arena - index. + Explicitly create a new arena outside the range of + automatically managed arenas, with optionally specified extent hooks, + and return the new arena index. diff --git a/include/jemalloc/internal/arena.h b/include/jemalloc/internal/arena.h index d889852e..929adbe9 100644 --- a/include/jemalloc/internal/arena.h +++ b/include/jemalloc/internal/arena.h @@ -148,9 +148,9 @@ struct arena_s { * atomic operations. Each thread has two distinct assignments, one for * application-serving allocation, and the other for internal metadata * allocation. Internal metadata must not be allocated from arenas - * created via the arenas.extend mallctl, because the arena..reset - * mallctl indiscriminately discards all allocations for the affected - * arena. + * explicitly created via the arenas.create mallctl, because the + * arena..reset mallctl indiscriminately discards all allocations for + * the affected arena. * * 0: Application allocation. * 1: Internal metadata allocation. diff --git a/src/ctl.c b/src/ctl.c index 4e5511e4..872da80f 100644 --- a/src/ctl.c +++ b/src/ctl.c @@ -133,7 +133,7 @@ CTL_PROTO(arenas_tcache_max) CTL_PROTO(arenas_nbins) CTL_PROTO(arenas_nhbins) CTL_PROTO(arenas_nlextents) -CTL_PROTO(arenas_extend) +CTL_PROTO(arenas_create) CTL_PROTO(prof_thread_active_init) CTL_PROTO(prof_active) CTL_PROTO(prof_dump) @@ -323,7 +323,7 @@ static const ctl_named_node_t arenas_node[] = { {NAME("bin"), CHILD(indexed, arenas_bin)}, {NAME("nlextents"), CTL(arenas_nlextents)}, {NAME("lextent"), CHILD(indexed, arenas_lextent)}, - {NAME("extend"), CTL(arenas_extend)} + {NAME("create"), CTL(arenas_create)} }; static const ctl_named_node_t prof_node[] = { @@ -1780,7 +1780,7 @@ arenas_lextent_i_index(tsdn_t *tsdn, const size_t *mib, size_t miblen, size_t i) } static int -arenas_extend_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp, +arenas_create_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp, size_t *oldlenp, void *newp, size_t newlen) { int ret; diff --git a/src/jemalloc.c b/src/jemalloc.c index 2c49401f..2acab412 100644 --- a/src/jemalloc.c +++ b/src/jemalloc.c @@ -533,7 +533,7 @@ arena_tdata_get_hard(tsd_t *tsd, unsigned ind) * Copy to tdata array. It's possible that the actual number of arenas * has increased since narenas_total_get() was called above, but that * causes no correctness issues unless two threads concurrently execute - * the arenas.extend mallctl, which we trust mallctl synchronization to + * the arenas.create mallctl, which we trust mallctl synchronization to * prevent. */ diff --git a/test/integration/MALLOCX_ARENA.c b/test/integration/MALLOCX_ARENA.c index 910a096f..58032da8 100644 --- a/test/integration/MALLOCX_ARENA.c +++ b/test/integration/MALLOCX_ARENA.c @@ -19,8 +19,8 @@ thd_start(void *arg) size_t sz; sz = sizeof(arena_ind); - assert_d_eq(mallctl("arenas.extend", (void *)&arena_ind, &sz, NULL, 0), - 0, "Error in arenas.extend"); + assert_d_eq(mallctl("arenas.create", (void *)&arena_ind, &sz, NULL, 0), + 0, "Error in arenas.create"); if (thread_ind % 4 != 3) { size_t mib[3]; diff --git a/test/integration/extent.c b/test/integration/extent.c index e2bd0054..6be3b836 100644 --- a/test/integration/extent.c +++ b/test/integration/extent.c @@ -292,7 +292,7 @@ TEST_BEGIN(test_extent_manual_hook) size_t hooks_miblen; sz = sizeof(unsigned); - assert_d_eq(mallctl("arenas.extend", (void *)&arena_ind, &sz, NULL, 0), + assert_d_eq(mallctl("arenas.create", (void *)&arena_ind, &sz, NULL, 0), 0, "Unexpected mallctl() failure"); /* Install custom extent hooks. */ @@ -354,7 +354,7 @@ TEST_BEGIN(test_extent_auto_hook) sz = sizeof(unsigned); new_size = sizeof(extent_hooks_t *); - assert_d_eq(mallctl("arenas.extend", (void *)&arena_ind, &sz, + assert_d_eq(mallctl("arenas.create", (void *)&arena_ind, &sz, (void *)&new_hooks, new_size), 0, "Unexpected mallctl() failure"); test_extent_body(arena_ind); diff --git a/test/integration/xallocx.c b/test/integration/xallocx.c index f6083728..d35ca39e 100644 --- a/test/integration/xallocx.c +++ b/test/integration/xallocx.c @@ -16,7 +16,7 @@ arena_ind(void) if (ind == 0) { size_t sz = sizeof(ind); - assert_d_eq(mallctl("arenas.extend", (void *)&ind, &sz, NULL, + assert_d_eq(mallctl("arenas.create", (void *)&ind, &sz, NULL, 0), 0, "Unexpected mallctl failure creating arena"); } diff --git a/test/unit/arena_reset.c b/test/unit/arena_reset.c index 6c944b2e..3a1b30f5 100644 --- a/test/unit/arena_reset.c +++ b/test/unit/arena_reset.c @@ -90,7 +90,7 @@ TEST_BEGIN(test_arena_reset) tsdn_t *tsdn; sz = sizeof(unsigned); - assert_d_eq(mallctl("arenas.extend", (void *)&arena_ind, &sz, NULL, 0), + assert_d_eq(mallctl("arenas.create", (void *)&arena_ind, &sz, NULL, 0), 0, "Unexpected mallctl() failure"); flags = MALLOCX_ARENA(arena_ind) | MALLOCX_TCACHE_NONE; diff --git a/test/unit/mallctl.c b/test/unit/mallctl.c index e0efdce1..95c27753 100644 --- a/test/unit/mallctl.c +++ b/test/unit/mallctl.c @@ -584,14 +584,14 @@ TEST_BEGIN(test_arenas_lextent_constants) } TEST_END -TEST_BEGIN(test_arenas_extend) +TEST_BEGIN(test_arenas_create) { unsigned narenas_before, arena, narenas_after; size_t sz = sizeof(unsigned); assert_d_eq(mallctl("arenas.narenas", (void *)&narenas_before, &sz, NULL, 0), 0, "Unexpected mallctl() failure"); - assert_d_eq(mallctl("arenas.extend", (void *)&arena, &sz, NULL, 0), 0, + assert_d_eq(mallctl("arenas.create", (void *)&arena, &sz, NULL, 0), 0, "Unexpected mallctl() failure"); assert_d_eq(mallctl("arenas.narenas", (void *)&narenas_after, &sz, NULL, 0), 0, "Unexpected mallctl() failure"); @@ -647,6 +647,6 @@ main(void) test_arenas_constants, test_arenas_bin_constants, test_arenas_lextent_constants, - test_arenas_extend, + test_arenas_create, test_stats_arenas)); } diff --git a/test/unit/pack.c b/test/unit/pack.c index 10df08e3..81ded4ec 100644 --- a/test/unit/pack.c +++ b/test/unit/pack.c @@ -68,14 +68,14 @@ nregs_per_run_compute(void) } static unsigned -arenas_extend_mallctl(void) +arenas_create_mallctl(void) { unsigned arena_ind; size_t sz; sz = sizeof(arena_ind); - assert_d_eq(mallctl("arenas.extend", (void *)&arena_ind, &sz, NULL, 0), - 0, "Error in arenas.extend"); + assert_d_eq(mallctl("arenas.create", (void *)&arena_ind, &sz, NULL, 0), + 0, "Error in arenas.create"); return (arena_ind); } @@ -95,7 +95,7 @@ arena_reset_mallctl(unsigned arena_ind) TEST_BEGIN(test_pack) { - unsigned arena_ind = arenas_extend_mallctl(); + unsigned arena_ind = arenas_create_mallctl(); size_t nregs_per_run = nregs_per_run_compute(); size_t nregs = nregs_per_run * NSLABS; VARIABLE_ARRAY(void *, ptrs, nregs);