Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

io_uring: move cq/sq user offset init around

Move user SQ/CQ offset initialisation at the end of io_prepare_config()
where it already calculated all information to set it properly.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Pavel Begunkov and committed by
Jens Axboe
d741c625 eb76ff6a

+20 -21
+20 -21
io_uring/io_uring.c
··· 3519 3519 p->cq_entries = 2 * p->sq_entries; 3520 3520 } 3521 3521 3522 - p->sq_off.head = offsetof(struct io_rings, sq.head); 3523 - p->sq_off.tail = offsetof(struct io_rings, sq.tail); 3524 - p->sq_off.ring_mask = offsetof(struct io_rings, sq_ring_mask); 3525 - p->sq_off.ring_entries = offsetof(struct io_rings, sq_ring_entries); 3526 - p->sq_off.flags = offsetof(struct io_rings, sq_flags); 3527 - p->sq_off.dropped = offsetof(struct io_rings, sq_dropped); 3528 - p->sq_off.resv1 = 0; 3529 - if (!(p->flags & IORING_SETUP_NO_MMAP)) 3530 - p->sq_off.user_addr = 0; 3531 - 3532 - p->cq_off.head = offsetof(struct io_rings, cq.head); 3533 - p->cq_off.tail = offsetof(struct io_rings, cq.tail); 3534 - p->cq_off.ring_mask = offsetof(struct io_rings, cq_ring_mask); 3535 - p->cq_off.ring_entries = offsetof(struct io_rings, cq_ring_entries); 3536 - p->cq_off.overflow = offsetof(struct io_rings, cq_overflow); 3537 - p->cq_off.cqes = offsetof(struct io_rings, cqes); 3538 - p->cq_off.flags = offsetof(struct io_rings, cq_flags); 3539 - p->cq_off.resv1 = 0; 3540 - if (!(p->flags & IORING_SETUP_NO_MMAP)) 3541 - p->cq_off.user_addr = 0; 3542 - 3543 3522 return 0; 3544 3523 } 3545 3524 ··· 3540 3561 if (ret) 3541 3562 return ret; 3542 3563 3564 + p->sq_off.head = offsetof(struct io_rings, sq.head); 3565 + p->sq_off.tail = offsetof(struct io_rings, sq.tail); 3566 + p->sq_off.ring_mask = offsetof(struct io_rings, sq_ring_mask); 3567 + p->sq_off.ring_entries = offsetof(struct io_rings, sq_ring_entries); 3568 + p->sq_off.flags = offsetof(struct io_rings, sq_flags); 3569 + p->sq_off.dropped = offsetof(struct io_rings, sq_dropped); 3570 + p->sq_off.resv1 = 0; 3571 + if (!(p->flags & IORING_SETUP_NO_MMAP)) 3572 + p->sq_off.user_addr = 0; 3573 + 3574 + p->cq_off.head = offsetof(struct io_rings, cq.head); 3575 + p->cq_off.tail = offsetof(struct io_rings, cq.tail); 3576 + p->cq_off.ring_mask = offsetof(struct io_rings, cq_ring_mask); 3577 + p->cq_off.ring_entries = offsetof(struct io_rings, cq_ring_entries); 3578 + p->cq_off.overflow = offsetof(struct io_rings, cq_overflow); 3579 + p->cq_off.cqes = offsetof(struct io_rings, cqes); 3580 + p->cq_off.flags = offsetof(struct io_rings, cq_flags); 3581 + p->cq_off.resv1 = 0; 3582 + if (!(p->flags & IORING_SETUP_NO_MMAP)) 3583 + p->cq_off.user_addr = 0; 3543 3584 if (!(p->flags & IORING_SETUP_NO_SQARRAY)) 3544 3585 p->sq_off.array = config->layout.sq_array_offset; 3545 3586