Use only space_left, not sqes_left

This commit is contained in:
Vitaliy Filippov
2025-11-23 15:17:57 +03:00
parent 5d3f3f47a7
commit 3ad83e8d13
4 changed files with 4 additions and 8 deletions
+1 -1
View File
@@ -275,7 +275,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->sqes_left() < PRIV(op)->wait_detail) if (ringloop->space_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
+1 -1
View File
@@ -27,7 +27,7 @@
#define IS_INSTANT(st) (((st) & BS_ST_TYPE_MASK) == BS_ST_DELETE || ((st) & BS_ST_INSTANT)) #define IS_INSTANT(st) (((st) & BS_ST_TYPE_MASK) == BS_ST_DELETE || ((st) & BS_ST_INSTANT))
#define BS_SUBMIT_CHECK_SQES(n) \ #define BS_SUBMIT_CHECK_SQES(n) \
if (ringloop->sqes_left() < (n))\ if (ringloop->space_left() < (n))\
{\ {\
/* Pause until there are more requests available */\ /* Pause until there are more requests available */\
PRIV(op)->wait_detail = (n);\ PRIV(op)->wait_detail = (n);\
+1 -1
View File
@@ -192,7 +192,7 @@ void ring_loop_t::restore(unsigned sqe_tail)
ring.sq.sqe_tail = sqe_tail; ring.sq.sqe_tail = sqe_tail;
} }
int ring_loop_t::sqes_left() unsigned ring_loop_t::space_left()
{ {
struct io_uring_sq *sq = &ring.sq; struct io_uring_sq *sq = &ring.sq;
unsigned int head = io_uring_smp_load_acquire(sq->khead); unsigned int head = io_uring_smp_load_acquire(sq->khead);
+1 -5
View File
@@ -68,11 +68,7 @@ public:
struct io_uring_cqe *cqe; struct io_uring_cqe *cqe;
return io_uring_wait_cqe(&ring, &cqe); return io_uring_wait_cqe(&ring, &cqe);
} }
int sqes_left(); unsigned space_left();
inline unsigned space_left()
{
return free_ring_data_ptr;
}
inline bool has_work() inline bool has_work()
{ {
return loop_again; return loop_again;