diff mbox series

[08/16] io_uring: compact SQ/CQ heads/tails

Message ID 5e3fade0f17f0357684536d77bc75e0028f2b62e.1692119257.git.asml.silence@gmail.com (mailing list archive)
State New
Headers show
Series caching and SQ/CQ optimisations | expand

Commit Message

Pavel Begunkov Aug. 15, 2023, 5:31 p.m. UTC
Queues heads and tails cache line aligned. That makes sq, cq taking 4
lines or 5 lines if we include the rest of struct io_rings (e.g.
sq_flags is frequently accessed).

Since modern io_uring is mostly single threaded, it doesn't make much
send to sread them as such, it wastes space and puts additional pressure
on caches. Put them all into a single line.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
---
 include/linux/io_uring_types.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Jens Axboe Aug. 19, 2023, 3:05 p.m. UTC | #1
On 8/15/23 11:31 AM, Pavel Begunkov wrote:
> Queues heads and tails cache line aligned. That makes sq, cq taking 4
> lines or 5 lines if we include the rest of struct io_rings (e.g.
> sq_flags is frequently accessed).
> 
> Since modern io_uring is mostly single threaded, it doesn't make much
> send to sread them as such, it wastes space and puts additional pressure

"sense to spread". Can fix up while applying. Change itself looks good
to me.
Pavel Begunkov Aug. 24, 2023, 4:29 p.m. UTC | #2
On 8/19/23 16:05, Jens Axboe wrote:
> On 8/15/23 11:31 AM, Pavel Begunkov wrote:
>> Queues heads and tails cache line aligned. That makes sq, cq taking 4
>> lines or 5 lines if we include the rest of struct io_rings (e.g.
>> sq_flags is frequently accessed).
>>
>> Since modern io_uring is mostly single threaded, it doesn't make much
>> send to sread them as such, it wastes space and puts additional pressure
> 
> "sense to spread". Can fix up while applying. Change itself looks good
> to me.

I'll be resending as we agreed, will fix it up, thanks
diff mbox series

Patch

diff --git a/include/linux/io_uring_types.h b/include/linux/io_uring_types.h
index c0c03d8059df..608a8e80e881 100644
--- a/include/linux/io_uring_types.h
+++ b/include/linux/io_uring_types.h
@@ -69,8 +69,8 @@  struct io_uring_task {
 };
 
 struct io_uring {
-	u32 head ____cacheline_aligned_in_smp;
-	u32 tail ____cacheline_aligned_in_smp;
+	u32 head;
+	u32 tail;
 };
 
 /*