1) Only read SQ ring head at the start of prep, we don't need to read
it at every iteration.
2) Initialize SQ ring index at init time, rather than in the fast path.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
{
struct io_sq_ring *ring = &s->sq_ring;
unsigned index, tail, next_tail, prepped = 0;
{
struct io_sq_ring *ring = &s->sq_ring;
unsigned index, tail, next_tail, prepped = 0;
+ unsigned int head = atomic_load_acquire(ring->head);
next_tail = tail = *ring->tail;
do {
next_tail++;
next_tail = tail = *ring->tail;
do {
next_tail++;
- if (next_tail == atomic_load_acquire(ring->head))
break;
index = tail & sq_ring_mask;
break;
index = tail & sq_ring_mask;
init_io_pt(s, index);
else
init_io(s, index);
init_io_pt(s, index);
else
init_io(s, index);
- ring->array[index] = index;
prepped++;
tail = next_tail;
} while (prepped < max_ios);
prepped++;
tail = next_tail;
} while (prepped < max_ios);
struct io_sq_ring *sring = &s->sq_ring;
struct io_cq_ring *cring = &s->cq_ring;
struct io_uring_params p;
struct io_sq_ring *sring = &s->sq_ring;
struct io_cq_ring *cring = &s->cq_ring;
struct io_uring_params p;
cring->ring_entries = ptr + p.cq_off.ring_entries;
cring->cqes = ptr + p.cq_off.cqes;
cq_ring_mask = *cring->ring_mask;
cring->ring_entries = ptr + p.cq_off.ring_entries;
cring->cqes = ptr + p.cq_off.cqes;
cq_ring_mask = *cring->ring_mask;
+
+ for (i = 0; i < p.sq_entries; i++)
+ sring->array[i] = i;
+