Do not overwrite same journal sector multiple times
It doesn't reduce actual WA, but it reduces tail latency (Q=32, 10% / 50% / 90% / 99% / 99.95%): - write: 766us/979us/1090us/1303us/1729us vs 1074us/1450us/2212us/3261us/4113us - sync: 701us/881us/1188us/1762us/2540us vs 269us/955us/1663us/2638us/4146us
This commit is contained in:
+9
-1
@@ -125,6 +125,12 @@ void blockstore_impl_t::loop()
|
||||
if (PRIV(op)->wait_for)
|
||||
{
|
||||
check_wait(op);
|
||||
#ifdef BLOCKSTORE_DEBUG
|
||||
if (PRIV(op)->wait_for)
|
||||
{
|
||||
printf("still waiting for %d\n", PRIV(op)->wait_for);
|
||||
}
|
||||
#endif
|
||||
if (PRIV(op)->wait_for == WAIT_SQE)
|
||||
{
|
||||
break;
|
||||
@@ -270,7 +276,9 @@ void blockstore_impl_t::check_wait(blockstore_op_t *op)
|
||||
}
|
||||
else if (PRIV(op)->wait_for == WAIT_JOURNAL_BUFFER)
|
||||
{
|
||||
if (journal.sector_info[((journal.cur_sector + 1) % journal.sector_count)].usage_count > 0)
|
||||
int next = ((journal.cur_sector + 1) % journal.sector_count);
|
||||
if (journal.sector_info[next].usage_count > 0 ||
|
||||
journal.sector_info[next].dirty)
|
||||
{
|
||||
// do not submit
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user