Commit eb76ff6
io_uring: pre-calculate scq layout
Move ring layouts calculations into io_prepare_config(), so that more
misconfiguration checking can be done earlier before creating a ctx.
It also deduplicates some code with ring resizing. And as a bonus, now
it initialises params->sq_off.array, which is closer to all other user
offset init, and also applies it to ring resizing, which was previously
missing it.
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>1 parent 001b76b commit eb76ff6
3 files changed
Lines changed: 15 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2757 | 2757 | | |
2758 | 2758 | | |
2759 | 2759 | | |
2760 | | - | |
2761 | | - | |
| 2760 | + | |
| 2761 | + | |
2762 | 2762 | | |
2763 | 2763 | | |
2764 | 2764 | | |
| |||
3353 | 3353 | | |
3354 | 3354 | | |
3355 | 3355 | | |
3356 | | - | |
| 3356 | + | |
3357 | 3357 | | |
| 3358 | + | |
| 3359 | + | |
3358 | 3360 | | |
3359 | | - | |
3360 | 3361 | | |
3361 | 3362 | | |
3362 | 3363 | | |
3363 | 3364 | | |
3364 | 3365 | | |
3365 | 3366 | | |
3366 | 3367 | | |
3367 | | - | |
3368 | | - | |
3369 | | - | |
3370 | | - | |
3371 | 3368 | | |
3372 | 3369 | | |
3373 | 3370 | | |
| |||
3378 | 3375 | | |
3379 | 3376 | | |
3380 | 3377 | | |
3381 | | - | |
3382 | 3378 | | |
3383 | 3379 | | |
3384 | 3380 | | |
| |||
3560 | 3556 | | |
3561 | 3557 | | |
3562 | 3558 | | |
| 3559 | + | |
| 3560 | + | |
| 3561 | + | |
| 3562 | + | |
| 3563 | + | |
| 3564 | + | |
| 3565 | + | |
| 3566 | + | |
3563 | 3567 | | |
3564 | 3568 | | |
3565 | 3569 | | |
| |||
3632 | 3636 | | |
3633 | 3637 | | |
3634 | 3638 | | |
3635 | | - | |
| 3639 | + | |
3636 | 3640 | | |
3637 | 3641 | | |
3638 | 3642 | | |
3639 | | - | |
3640 | | - | |
3641 | | - | |
3642 | 3643 | | |
3643 | 3644 | | |
3644 | 3645 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
147 | 148 | | |
148 | 149 | | |
149 | 150 | | |
150 | | - | |
151 | | - | |
152 | 151 | | |
153 | 152 | | |
154 | 153 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
423 | 423 | | |
424 | 424 | | |
425 | 425 | | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | 426 | | |
431 | 427 | | |
432 | 428 | | |
| |||
0 commit comments