Commit 34d2bfe
committed
io_uring: improve task work cache utilization
While profiling task_work intensive workloads, I noticed that most of
the time in tctx_task_work() is spending stalled on loading 'req'. This
is one of the unfortunate side effects of using linked lists,
particularly when they end up being passe around.
Prefetch the next request, if there is one. There's a sufficient amount
of work in between that this makes it available for the next loop.
While fiddling with the cache layout, move the link outside of the
hot completion cacheline. It's rarely used in hot workloads, so better
to bring in kbuf which is used for networked loads with provided buffers.
This reduces tctx_task_work() overhead from ~3% to 1-1.5% in my testing.
Signed-off-by: Jens Axboe <axboe@kernel.dk>1 parent a73825b commit 34d2bfe
1 file changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
928 | 928 | | |
929 | 929 | | |
930 | 930 | | |
931 | | - | |
932 | 931 | | |
933 | 932 | | |
934 | 933 | | |
| |||
939 | 938 | | |
940 | 939 | | |
941 | 940 | | |
| 941 | + | |
942 | 942 | | |
943 | 943 | | |
944 | 944 | | |
| |||
2451 | 2451 | | |
2452 | 2452 | | |
2453 | 2453 | | |
| 2454 | + | |
| 2455 | + | |
2454 | 2456 | | |
2455 | 2457 | | |
2456 | 2458 | | |
| |||
2483 | 2485 | | |
2484 | 2486 | | |
2485 | 2487 | | |
| 2488 | + | |
| 2489 | + | |
2486 | 2490 | | |
2487 | 2491 | | |
2488 | 2492 | | |
| |||
0 commit comments