From 8049e3c14abbc2831048ccdea8a11b46544da1c5 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Thu, 26 Jun 2025 01:25:59 +0300 Subject: [PATCH] Use OP_WRITE_STABLE in bs_fio --- src/blockstore/blockstore.h | 8 ++++---- src/blockstore/fio_engine.cpp | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/blockstore/blockstore.h b/src/blockstore/blockstore.h index deb599e7..950fdaa9 100644 --- a/src/blockstore/blockstore.h +++ b/src/blockstore/blockstore.h @@ -147,7 +147,7 @@ Output: struct blockstore_op_t { // operation - uint64_t opcode; + uint64_t opcode = 0; // finish callback std::function callback; union __attribute__((__packed__)) @@ -171,9 +171,9 @@ struct blockstore_op_t uint32_t list_stable_limit; }; }; - void *buf; - void *bitmap; - int retval; + void *buf = NULL; + void *bitmap = NULL; + int retval = 0; uint8_t private_data[BS_OP_PRIVATE_DATA_SIZE]; }; diff --git a/src/blockstore/fio_engine.cpp b/src/blockstore/fio_engine.cpp index 314b5de8..3b3964ce 100644 --- a/src/blockstore/fio_engine.cpp +++ b/src/blockstore/fio_engine.cpp @@ -5,14 +5,14 @@ // // Initialize storage for tests: // -// dd if=/dev/zero of=test_data.bin bs=1024 count=1048576 -// dd if=/dev/zero of=test_meta.bin bs=1024 count=256 -// dd if=/dev/zero of=test_journal.bin bs=1024 count=4096 +// dd if=/dev/zero of=test_data.bin bs=1M count=1024 // // Random write: // -// fio -thread -ioengine=./libfio_blockstore.so -name=test -bs=4k -direct=1 -fsync=16 -iodepth=16 -rw=randwrite \ -// -bs_config='{"data_device":"./test_data.bin"}' -size=1000M +// [LD_PRELOAD=libasan.so.8] \ +// fio -name=test -thread -ioengine=../build/src/blockstore/libfio_vitastor_blk.so \ +// -bs=4k -direct=1 -rw=randwrite -iodepth=16 -size=900M -loops=10 \ +// -bs_config='{"data_device":"./test_data.bin","meta_offset":0,"journal_offset":16777216,"data_offset":33554432,"disable_data_fsync":true,"immediate_commit":"all","journal_no_same_sector_overwrites":true}' // // Linear write: // @@ -189,7 +189,7 @@ static enum fio_q_status bs_queue(struct thread_data *td, struct io_u *io) }; break; case DDIR_WRITE: - op->opcode = BS_OP_WRITE; + op->opcode = BS_OP_WRITE_STABLE; op->buf = io->xfer_buf; op->oid = { .inode = 1,