diff --git a/.cirrus.yml b/.cirrus.yml index 1ea58906cc816ba419e4f37e618f3075492c6aae..caabe833e1d026ba62e6c037ea0807a8ef314578 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -7,4 +7,4 @@ task: autoconf bash binutils coreutils e2fsprogs-libuuid git gmake libunwind ncurses pkgconf hs-pandoc - script: CFLAGS="-Wno-unused-value" gmake + script: CFLAGS="-Wno-unused-value" gmake \ No newline at end of file diff --git a/src/libpmemobj/heap.c b/src/libpmemobj/heap.c index 4cbb52c42914eba6537535697fe8de6ad6d83715..a45e5742d369aa0d8cd80bd52fc7837e3144f039 100644 --- a/src/libpmemobj/heap.c +++ b/src/libpmemobj/heap.c @@ -953,11 +953,11 @@ heap_split_block(struct palloc_heap *heap, struct bucket *b, uint32_t new_chunk_id = m->chunk_id + units; uint32_t new_size_idx = m->size_idx - units; - *m = memblock_huge_init(heap, m->chunk_id, m->zone_id, units); - struct memory_block n = memblock_huge_init(heap, new_chunk_id, m->zone_id, new_size_idx); + *m = memblock_huge_init(heap, m->chunk_id, m->zone_id, units); + if (bucket_insert_block(b, &n) != 0) LOG(2, "failed to allocate memory block runtime tracking info"); diff --git a/src/libpmemobj/memops.c b/src/libpmemobj/memops.c index 65fd2ff80dfa3c9ca3c40b3bb727e90a293c9df1..81464e66336f0c4674c69ac5ea7910a3c42a6e09 100644 --- a/src/libpmemobj/memops.c +++ b/src/libpmemobj/memops.c @@ -137,6 +137,14 @@ operation_transient_clean(void *base, const void *addr, size_t len, return 0; } +/* + * operation_transient_drain -- noop + */ +static void +operation_transient_drain(void *base) +{ +} + /* * operation_transient_memcpy -- transient memcpy wrapper */ @@ -181,10 +189,12 @@ operation_new(struct ulog *ulog, size_t ulog_base_nbytes, ctx->t_ops.base = NULL; ctx->t_ops.flush = operation_transient_clean; ctx->t_ops.memcpy = operation_transient_memcpy; + ctx->t_ops.drain = operation_transient_drain; ctx->s_ops.base = p_ops->base; ctx->s_ops.flush = operation_transient_clean; ctx->s_ops.memcpy = operation_transient_memcpy; + ctx->s_ops.drain = operation_transient_drain; VECQ_INIT(&ctx->merge_entries); diff --git a/src/libpmemobj/tx.c b/src/libpmemobj/tx.c index b22f93171d079331dedfdd2f12297c1f2de39cbc..2213dd04abc1a0e2a77c0aec0be4844e751faaf1 100644 --- a/src/libpmemobj/tx.c +++ b/src/libpmemobj/tx.c @@ -388,6 +388,7 @@ tx_abort_set(PMEMobjpool *pop, struct lane *lane) ulog_foreach_entry((struct ulog *)&lane->layout->undo, tx_undo_entry_apply, NULL, &pop->p_ops); + pmemops_drain(&pop->p_ops); operation_finish(lane->undo, ULOG_INC_FIRST_GEN_NUM); } diff --git a/src/libpmemobj/ulog.c b/src/libpmemobj/ulog.c index 74eb15b43eddcd1c784823fb476fda4ec0c5751f..1f03e2c0148338c522910f64408592189b258fc5 100644 --- a/src/libpmemobj/ulog.c +++ b/src/libpmemobj/ulog.c @@ -9,6 +9,7 @@ #include <string.h> #include "libpmemobj.h" +#include "pmemops.h" #include "ulog.h" #include "obj.h" #include "out.h" @@ -791,6 +792,7 @@ ulog_process(struct ulog *ulog, ulog_check_offset_fn check, #endif ulog_foreach_entry(ulog, ulog_process_entry, NULL, p_ops); + pmemops_drain(p_ops); } /* diff --git a/src/test/obj_persist_count/out1.log.match b/src/test/obj_persist_count/out1.log.match index f21a163d2aa1a37b7879f49868ce844df4f1e505..05e34801246bc7c2968c40edb889018619776703 100644 --- a/src/test/obj_persist_count/out1.log.match +++ b/src/test/obj_persist_count/out1.log.match @@ -3,7 +3,7 @@ obj_persist_count$(nW)TEST1: START: obj_persist_count task cl(all) drain(all) pmem_persist pmem_msync pmem_flush pmem_drain pmem_memcpy_cls pmem_memcpy_drain pmem_memset_cls pmem_memset_drain potential_cache_misses $(OPT)pool_create 49282 14 11 0 0 0 0 0 11 3 49275 $(OPX)pool_create 49602 24 11 5 0 5 0 0 11 3 49595 -root_alloc 9 4 0 0 3 1 4 2 2 1 5 +root_alloc 9 5 0 0 3 2 4 2 2 1 5 atomic_alloc 2 2 1 0 0 1 1 0 0 0 1 atomic_free 1 2 1 0 0 1 0 0 0 0 1 tx_begin_end 0 2 0 0 0 2 0 0 0 0 0 @@ -13,10 +13,10 @@ tx_free 1 1 1 0 0 0 tx_free_next 1 1 1 0 0 0 0 0 0 0 1 tx_add 3 3 1 0 0 1 1 0 1 1 1 tx_add_next 3 3 1 0 0 1 1 0 1 1 1 -tx_add_large 178 13 6 0 4 3 165 2 3 2 10 +tx_add_large 178 14 6 0 4 4 165 2 3 2 10 tx_add_lnext 164 5 1 0 0 2 161 0 2 2 1 -pmalloc 6 3 0 0 2 1 4 2 0 0 2 -pfree 5 3 0 0 2 1 3 2 0 0 2 +pmalloc 6 4 0 0 2 2 4 2 0 0 2 +pfree 5 4 0 0 2 2 3 2 0 0 2 pmalloc_stack 2 2 1 0 0 1 1 0 0 0 1 pfree_stack 1 2 1 0 0 1 0 0 0 0 1 obj_persist_count$(nW)TEST1: DONE diff --git a/src/test/obj_reorder_basic/obj_reorder_basic.c b/src/test/obj_reorder_basic/obj_reorder_basic.c index ad22157bbbeb4e8c5526717919d153616abfafd8..9cafd1fff5a70876fdf3a31b348b837e297300a6 100644 --- a/src/test/obj_reorder_basic/obj_reorder_basic.c +++ b/src/test/obj_reorder_basic/obj_reorder_basic.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BSD-3-Clause -/* Copyright 2018, Intel Corporation */ +/* Copyright 2018-2020, Intel Corporation */ /* * obj_reorder_basic.c -- a simple unit test for store reordering @@ -70,10 +70,15 @@ main(int argc, char *argv[]) if (argc != 3 || strchr("wc", argv[1][0]) == 0 || argv[1][1] != '\0') UT_FATAL("usage: %s w|c file", argv[0]); + char opt = argv[1][0]; + if (opt == 'c') { + int y = 1; + pmemobj_ctl_set(NULL, "copy_on_write.at_open", &y); + } + PMEMobjpool *pop = pmemobj_open(argv[2], LAYOUT_NAME); UT_ASSERT(pop != NULL); - char opt = argv[1][0]; VALGRIND_EMIT_LOG("PMREORDER_MARKER_WRITE.BEGIN"); switch (opt) { case 'w': diff --git a/src/test/unittest/unittest.sh b/src/test/unittest/unittest.sh index bf1fc796df64d654e45bacedd310921cb11caf08..5c39a5d0bf1d90991e1dcfb6fe93fdaf4044d709 100644 --- a/src/test/unittest/unittest.sh +++ b/src/test/unittest/unittest.sh @@ -3539,7 +3539,7 @@ function pmreorder_run_tool() # function pmreorder_expect_success() { - ret=$(pmreorder_run_tool "$@") + ret=$(pmreorder_run_tool "$@" | tail -n1) if [ "$ret" -ne "0" ]; then msg=$(interactive_red STDERR "failed with exit code $ret") @@ -3561,7 +3561,7 @@ function pmreorder_expect_success() # function pmreorder_expect_failure() { - ret=$(pmreorder_run_tool "$@") + ret=$(pmreorder_run_tool "$@" | tail -n1) if [ "$ret" -eq "0" ]; then msg=$(interactive_red STDERR "succeeded")