Do not use goto resume_0 due to some strange -O3 bug which leads to hangs (it seems it optimizes flush_queue.size() away)

blocking-uring-test
Vitaliy Filippov 2019-12-03 02:14:25 +03:00
parent fd13965b90
commit 1f7381e220
3 changed files with 6 additions and 9 deletions

View File

@ -165,10 +165,6 @@ void blockstore::loop()
{
dequeue_op = dequeue_stable(op);
}
else if ((op->flags & OP_TYPE_MASK) == OP_DELETE)
{
// FIXME: Implement DELETE
}
if (dequeue_op)
{
submit_queue.erase(op_ptr);

View File

@ -152,7 +152,6 @@ bool journal_flusher_co::loop()
goto resume_17;
else if (wait_state == 18)
goto resume_18;
resume_0:
if (!flusher->flush_queue.size() ||
!flusher->start_forced && !flusher->active_flushers && flusher->flush_queue.size() < flusher->sync_threshold)
{
@ -179,7 +178,8 @@ resume_0:
// Another coroutine will see it and re-queue the object after it finishes
if (repeat_it->second < cur.version)
repeat_it->second = cur.version;
goto resume_0;
wait_state = 0;
return true;
}
else
flusher->sync_to_repeat[cur.oid] = 0;
@ -278,7 +278,8 @@ resume_0:
flusher->unshift_flush({ .oid = cur.oid, .version = repeat_it->second });
}
flusher->sync_to_repeat.erase(repeat_it);
goto resume_0;
wait_state = 0;
return true;
}
// Find it in clean_db
{
@ -476,7 +477,8 @@ resume_0:
flusher->unshift_flush({ .oid = cur.oid, .version = repeat_it->second });
}
flusher->sync_to_repeat.erase(repeat_it);
goto resume_0;
wait_state = 0;
return true;
}
return true;
}

View File

@ -142,7 +142,6 @@ static int bs_init(struct thread_data *td)
{
bs_options *o = (bs_options*)td->eo;
bs_data *bsd = (bs_data*)td->io_ops_data;
int r;
blockstore_config_t config;
config["journal_device"] = o->journal_device;