io_uring/io-wq: eliminate redundant io_work_get_acct() calls
authorMax Kellermann <max.kellermann@ionos.com>
Tue, 28 Jan 2025 13:39:20 +0000 (14:39 +0100)
committerJens Axboe <axboe@kernel.dk>
Mon, 3 Feb 2025 02:52:08 +0000 (19:52 -0700)
commit14ed10013bb4b0641ee4a819760ab2b4de22b8c7
tree45ec72bfc3721b6eab8c50eaf923dc000be475da
parent2014c95afecee3e76ca4a56956a936e23283f05b
io_uring/io-wq: eliminate redundant io_work_get_acct() calls

Instead of calling io_work_get_acct() again, pass acct to
io_wq_insert_work() and io_wq_remove_pending().

This atomic access in io_work_get_acct() was done under the
`acct->lock`, and optimizing it away reduces lock contention a bit.

Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
Link: https://lore.kernel.org/r/20250128133927.3989681-2-max.kellermann@ionos.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/io-wq.c