]> git.itanic.dy.fi Git - linux-stable/commit
block: improve struct request_queue layout
authorJens Axboe <axboe@kernel.dk>
Thu, 14 Dec 2023 18:08:15 +0000 (11:08 -0700)
committerJens Axboe <axboe@kernel.dk>
Fri, 15 Dec 2023 14:34:51 +0000 (07:34 -0700)
commit0c734c5ea76e333fbb8dd83b5bab46291b38096b
tree15e821b453c4c775abb27f2715b68eaa27403be2
parent6ef02df154a245a4a7c0a66daa5a353daa788dba
block: improve struct request_queue layout

It's clearly been a while since someone looked at this, so I gave it a
quick shot. There are few issues in here:

- Random bundling of members that are mostly read-only and often written
- Random holes that need not be there

This moves the most frequently used bits into cacheline 1 and 2, with
the 2nd one being more write intensive than the first one, which is
basically read-only.

Outside of making this work a bit more efficiently, it also reduces the
size of struct request_queue for my test setup from 864 bytes (spanning
14 cachelines!) to 832 bytes and 13 cachelines.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/d2b7b61c-4868-45c0-9060-4f9c73de9d7e@kernel.dk
Signed-off-by: Jens Axboe <axboe@kernel.dk>
include/linux/blkdev.h