Skip to content

Commit b000ae0

Browse files
isilenceaxboe
authored andcommitted
io_uring/rsrc: optimise single entry advance
Iterating within the first bvec entry should be essentially free, but we use iov_iter_advance() for that, which shows up in benchmark profiles taking up to 0.5% of CPU. Replace it with a hand coded version. Signed-off-by: Pavel Begunkov <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent edd4782 commit b000ae0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

io_uring/rsrc.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1364,7 +1364,10 @@ int io_import_fixed(int ddir, struct iov_iter *iter,
13641364
const struct bio_vec *bvec = imu->bvec;
13651365

13661366
if (offset <= bvec->bv_len) {
1367-
iov_iter_advance(iter, offset);
1367+
iter->bvec = bvec;
1368+
iter->nr_segs = bvec->bv_len;
1369+
iter->count -= offset;
1370+
iter->iov_offset = offset;
13681371
} else {
13691372
unsigned long seg_skip;
13701373

0 commit comments

Comments
 (0)