Re: [PATCH 7/8] io_uring: cache io_kiocb->flags in variable

From: Jens Axboe
Date: Tue Feb 04 2025 - 14:46:25 EST


On 2/4/25 5:07 AM, Pavel Begunkov wrote:
> On 1/29/25 19:11, Pavel Begunkov wrote:
>> 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.
>
> Jens, I'd suggest to drop it out of the tree, for the reasons above.

Yep I'll drop it, thanks.

--
Jens Axboe