forked from vitalif/vitastor
Fix another part of the "async sqe clear" bug (followup to d9857a5340
)
parent
ebaf4d7a72
commit
df0cd85352
|
@ -142,7 +142,6 @@ void blockstore_impl_t::loop()
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unsigned ring_space = ringloop->space_left();
|
|
||||||
unsigned prev_sqe_pos = ringloop->save();
|
unsigned prev_sqe_pos = ringloop->save();
|
||||||
// 0 = can't submit
|
// 0 = can't submit
|
||||||
// 1 = in progress
|
// 1 = in progress
|
||||||
|
@ -212,7 +211,6 @@ void blockstore_impl_t::loop()
|
||||||
ringloop->restore(prev_sqe_pos);
|
ringloop->restore(prev_sqe_pos);
|
||||||
if (PRIV(op)->wait_for == WAIT_SQE)
|
if (PRIV(op)->wait_for == WAIT_SQE)
|
||||||
{
|
{
|
||||||
PRIV(op)->wait_detail = 1 + ring_space;
|
|
||||||
// ring is full, stop submission
|
// ring is full, stop submission
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -282,7 +280,7 @@ void blockstore_impl_t::check_wait(blockstore_op_t *op)
|
||||||
{
|
{
|
||||||
if (PRIV(op)->wait_for == WAIT_SQE)
|
if (PRIV(op)->wait_for == WAIT_SQE)
|
||||||
{
|
{
|
||||||
if (ringloop->space_left() < PRIV(op)->wait_detail)
|
if (ringloop->sqes_left() < PRIV(op)->wait_detail)
|
||||||
{
|
{
|
||||||
// stop submission if there's still no free space
|
// stop submission if there's still no free space
|
||||||
#ifdef BLOCKSTORE_DEBUG
|
#ifdef BLOCKSTORE_DEBUG
|
||||||
|
|
|
@ -58,6 +58,7 @@
|
||||||
if (ringloop->sqes_left() < (n))\
|
if (ringloop->sqes_left() < (n))\
|
||||||
{\
|
{\
|
||||||
/* Pause until there are more requests available */\
|
/* Pause until there are more requests available */\
|
||||||
|
PRIV(op)->wait_detail = (n);\
|
||||||
PRIV(op)->wait_for = WAIT_SQE;\
|
PRIV(op)->wait_for = WAIT_SQE;\
|
||||||
return 0;\
|
return 0;\
|
||||||
}
|
}
|
||||||
|
@ -71,6 +72,7 @@
|
||||||
if (!sqe)\
|
if (!sqe)\
|
||||||
{\
|
{\
|
||||||
/* Pause until there are more requests available */\
|
/* Pause until there are more requests available */\
|
||||||
|
PRIV(op)->wait_detail = 1;\
|
||||||
PRIV(op)->wait_for = WAIT_SQE;\
|
PRIV(op)->wait_for = WAIT_SQE;\
|
||||||
return 0;\
|
return 0;\
|
||||||
}
|
}
|
||||||
|
@ -80,6 +82,7 @@
|
||||||
if (!sqe)\
|
if (!sqe)\
|
||||||
{\
|
{\
|
||||||
/* Pause until there are more requests available */\
|
/* Pause until there are more requests available */\
|
||||||
|
PRIV(op)->wait_detail = 1;\
|
||||||
PRIV(op)->wait_for = WAIT_SQE;\
|
PRIV(op)->wait_for = WAIT_SQE;\
|
||||||
return 0;\
|
return 0;\
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue