Compare commits
5 Commits
aff6f3e970
...
4f99f78430
Author | SHA1 | Date |
---|---|---|
Vitaliy Filippov | 4f99f78430 | |
Vitaliy Filippov | f926f8c2e0 | |
Vitaliy Filippov | d73ad12c56 | |
Vitaliy Filippov | d68cec10e2 | |
Vitaliy Filippov | 9afa200a33 |
|
@ -393,6 +393,7 @@ void blockstore_impl_t::init_op(blockstore_op_t *op)
|
||||||
{
|
{
|
||||||
// Call constructor without allocating memory. We'll call destructor before returning op back
|
// Call constructor without allocating memory. We'll call destructor before returning op back
|
||||||
new ((void*)op->private_data) blockstore_op_private_t;
|
new ((void*)op->private_data) blockstore_op_private_t;
|
||||||
|
PRIV(op)->min_flushed_journal_sector = PRIV(op)->max_flushed_journal_sector = 0;
|
||||||
PRIV(op)->wait_for = 0;
|
PRIV(op)->wait_for = 0;
|
||||||
PRIV(op)->op_state = 0;
|
PRIV(op)->op_state = 0;
|
||||||
PRIV(op)->pending_ops = 0;
|
PRIV(op)->pending_ops = 0;
|
||||||
|
|
|
@ -210,7 +210,7 @@ struct blockstore_op_private_t
|
||||||
std::vector<copy_buffer_t> read_vec;
|
std::vector<copy_buffer_t> read_vec;
|
||||||
|
|
||||||
// Sync, write
|
// Sync, write
|
||||||
int min_flushed_journal_sector, max_flushed_journal_sector;
|
uint64_t min_flushed_journal_sector, max_flushed_journal_sector;
|
||||||
|
|
||||||
// Write
|
// Write
|
||||||
struct iovec iov_zerofill[3];
|
struct iovec iov_zerofill[3];
|
||||||
|
@ -220,7 +220,6 @@ struct blockstore_op_private_t
|
||||||
|
|
||||||
// Sync
|
// Sync
|
||||||
std::vector<obj_ver_id> sync_big_writes, sync_small_writes;
|
std::vector<obj_ver_id> sync_big_writes, sync_small_writes;
|
||||||
int sync_small_checked, sync_big_checked;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef uint32_t pool_id_t;
|
typedef uint32_t pool_id_t;
|
||||||
|
|
|
@ -198,6 +198,7 @@ void blockstore_impl_t::prepare_journal_sector_write(int cur_sector, blockstore_
|
||||||
priv->pending_ops++;
|
priv->pending_ops++;
|
||||||
if (!priv->min_flushed_journal_sector)
|
if (!priv->min_flushed_journal_sector)
|
||||||
priv->min_flushed_journal_sector = 1+cur_sector;
|
priv->min_flushed_journal_sector = 1+cur_sector;
|
||||||
|
assert(priv->min_flushed_journal_sector <= journal.sector_count);
|
||||||
priv->max_flushed_journal_sector = 1+cur_sector;
|
priv->max_flushed_journal_sector = 1+cur_sector;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,8 +27,6 @@ int blockstore_impl_t::continue_sync(blockstore_op_t *op)
|
||||||
unsynced_big_write_count -= unsynced_big_writes.size();
|
unsynced_big_write_count -= unsynced_big_writes.size();
|
||||||
PRIV(op)->sync_big_writes.swap(unsynced_big_writes);
|
PRIV(op)->sync_big_writes.swap(unsynced_big_writes);
|
||||||
PRIV(op)->sync_small_writes.swap(unsynced_small_writes);
|
PRIV(op)->sync_small_writes.swap(unsynced_small_writes);
|
||||||
PRIV(op)->sync_small_checked = 0;
|
|
||||||
PRIV(op)->sync_big_checked = 0;
|
|
||||||
unsynced_big_writes.clear();
|
unsynced_big_writes.clear();
|
||||||
unsynced_small_writes.clear();
|
unsynced_small_writes.clear();
|
||||||
if (PRIV(op)->sync_big_writes.size() > 0)
|
if (PRIV(op)->sync_big_writes.size() > 0)
|
||||||
|
|
|
@ -378,7 +378,6 @@ int blockstore_impl_t::dequeue_write(blockstore_op_t *op)
|
||||||
sqe, dsk.data_fd, PRIV(op)->iov_zerofill, vcnt, dsk.data_offset + (loc << dsk.block_order) + op->offset - stripe_offset
|
sqe, dsk.data_fd, PRIV(op)->iov_zerofill, vcnt, dsk.data_offset + (loc << dsk.block_order) + op->offset - stripe_offset
|
||||||
);
|
);
|
||||||
PRIV(op)->pending_ops = 1;
|
PRIV(op)->pending_ops = 1;
|
||||||
PRIV(op)->min_flushed_journal_sector = PRIV(op)->max_flushed_journal_sector = 0;
|
|
||||||
if (immediate_commit != IMMEDIATE_ALL)
|
if (immediate_commit != IMMEDIATE_ALL)
|
||||||
{
|
{
|
||||||
// Increase the counter, but don't save into unsynced_writes yet (can't sync until the write is finished)
|
// Increase the counter, but don't save into unsynced_writes yet (can't sync until the write is finished)
|
||||||
|
@ -415,16 +414,10 @@ int blockstore_impl_t::dequeue_write(blockstore_op_t *op)
|
||||||
write_iodepth++;
|
write_iodepth++;
|
||||||
// Got SQEs. Prepare previous journal sector write if required
|
// Got SQEs. Prepare previous journal sector write if required
|
||||||
auto cb = [this, op](ring_data_t *data) { handle_write_event(data, op); };
|
auto cb = [this, op](ring_data_t *data) { handle_write_event(data, op); };
|
||||||
if (immediate_commit == IMMEDIATE_NONE)
|
if (immediate_commit == IMMEDIATE_NONE &&
|
||||||
|
!journal.entry_fits(sizeof(journal_entry_small_write) + dyn_size))
|
||||||
{
|
{
|
||||||
if (!journal.entry_fits(sizeof(journal_entry_small_write) + dyn_size))
|
prepare_journal_sector_write(journal.cur_sector, op);
|
||||||
{
|
|
||||||
prepare_journal_sector_write(journal.cur_sector, op);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
PRIV(op)->min_flushed_journal_sector = PRIV(op)->max_flushed_journal_sector = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// Then pre-fill journal entry
|
// Then pre-fill journal entry
|
||||||
journal_entry_small_write *je = (journal_entry_small_write*)prefill_single_journal_entry(
|
journal_entry_small_write *je = (journal_entry_small_write*)prefill_single_journal_entry(
|
||||||
|
@ -750,17 +743,11 @@ int blockstore_impl_t::dequeue_del(blockstore_op_t *op)
|
||||||
}
|
}
|
||||||
write_iodepth++;
|
write_iodepth++;
|
||||||
// Prepare journal sector write
|
// Prepare journal sector write
|
||||||
if (immediate_commit == IMMEDIATE_NONE)
|
if (immediate_commit == IMMEDIATE_NONE &&
|
||||||
|
(dsk.journal_block_size - journal.in_sector_pos) < sizeof(journal_entry_del) &&
|
||||||
|
journal.sector_info[journal.cur_sector].dirty)
|
||||||
{
|
{
|
||||||
if ((dsk.journal_block_size - journal.in_sector_pos) < sizeof(journal_entry_del) &&
|
prepare_journal_sector_write(journal.cur_sector, op);
|
||||||
journal.sector_info[journal.cur_sector].dirty)
|
|
||||||
{
|
|
||||||
prepare_journal_sector_write(journal.cur_sector, op);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
PRIV(op)->min_flushed_journal_sector = PRIV(op)->max_flushed_journal_sector = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// Pre-fill journal entry
|
// Pre-fill journal entry
|
||||||
journal_entry_del *je = (journal_entry_del*)prefill_single_journal_entry(
|
journal_entry_del *je = (journal_entry_del*)prefill_single_journal_entry(
|
||||||
|
|
|
@ -357,6 +357,8 @@ static int run(cli_tool_t *p, json11::Json::object cfg)
|
||||||
p->ringloop = NULL;
|
p->ringloop = NULL;
|
||||||
}
|
}
|
||||||
// Print result
|
// Print result
|
||||||
|
fflush(stderr);
|
||||||
|
fflush(stdout);
|
||||||
if (p->json_output && !result.data.is_null())
|
if (p->json_output && !result.data.is_null())
|
||||||
{
|
{
|
||||||
printf("%s\n", result.data.dump().c_str());
|
printf("%s\n", result.data.dump().c_str());
|
||||||
|
|
|
@ -242,6 +242,7 @@ static enum fio_q_status sec_queue(struct thread_data *td, struct io_u *io)
|
||||||
op.sec_rw.version = UINT64_MAX; // last unstable
|
op.sec_rw.version = UINT64_MAX; // last unstable
|
||||||
op.sec_rw.offset = io->offset % bsd->block_size;
|
op.sec_rw.offset = io->offset % bsd->block_size;
|
||||||
op.sec_rw.len = io->xfer_buflen;
|
op.sec_rw.len = io->xfer_buflen;
|
||||||
|
op.sec_rw.attr_len = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -263,6 +264,7 @@ static enum fio_q_status sec_queue(struct thread_data *td, struct io_u *io)
|
||||||
op.sec_rw.version = 0; // assign automatically
|
op.sec_rw.version = 0; // assign automatically
|
||||||
op.sec_rw.offset = io->offset % bsd->block_size;
|
op.sec_rw.offset = io->offset % bsd->block_size;
|
||||||
op.sec_rw.len = io->xfer_buflen;
|
op.sec_rw.len = io->xfer_buflen;
|
||||||
|
op.sec_rw.attr_len = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -649,7 +649,7 @@ void osd_t::apply_pg_config()
|
||||||
auto pg_it = this->pgs.find({ .pool_id = pool_id, .pg_num = pg_num });
|
auto pg_it = this->pgs.find({ .pool_id = pool_id, .pg_num = pg_num });
|
||||||
bool currently_taken = pg_it != this->pgs.end() && pg_it->second.state != PG_OFFLINE;
|
bool currently_taken = pg_it != this->pgs.end() && pg_it->second.state != PG_OFFLINE;
|
||||||
// Check pool block size and bitmap granularity
|
// Check pool block size and bitmap granularity
|
||||||
if (this->bs_block_size != pool_item.second.data_block_size ||
|
if (take && this->bs_block_size != pool_item.second.data_block_size ||
|
||||||
this->bs_bitmap_granularity != pool_item.second.bitmap_granularity)
|
this->bs_bitmap_granularity != pool_item.second.bitmap_granularity)
|
||||||
{
|
{
|
||||||
if (!warned_block_size)
|
if (!warned_block_size)
|
||||||
|
|
Loading…
Reference in New Issue