[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a7733b94-c7c0-4e95-975d-e45562d54f3f@gmail.com>
Date: Wed, 29 Jan 2025 19:11:23 +0000
From: Pavel Begunkov <asml.silence@...il.com>
To: Max Kellermann <max.kellermann@...os.com>, axboe@...nel.dk,
io-uring@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 7/8] io_uring: cache io_kiocb->flags in variable
On 1/28/25 13:39, Max Kellermann wrote:
> This eliminates several redundant reads, some of which probably cannot
> be optimized away by the compiler.
Let's not, it hurts readability with no clear benefits. In most cases
the compiler will be able to optimise it just where it matters, and
in cold paths we're comparing the overhead of reading a cached variable
with taking locks and doing indirect calls, and even then it'd likely
need to be saved onto the stack and loaded back.
The only place where it might be worth it is io_issue_sqe(), and
even then I'd doubt it.
--
Pavel Begunkov
Powered by blists - more mailing lists