public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
From: Pavel Begunkov <asml.silence@gmail.com>
To: Jens Axboe <axboe@kernel.dk>,
	Caleb Sander Mateos <csander@purestorage.com>
Cc: io-uring@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] io_uring: pass struct io_tw_state by value
Date: Wed, 12 Feb 2025 14:49:17 +0000	[thread overview]
Message-ID: <b478f8fd-d43b-429c-aa6c-1b94951421ab@gmail.com> (raw)
In-Reply-To: <8c21acb0-aee5-4628-a267-a4edc85616c4@kernel.dk>

On 2/12/25 14:33, Jens Axboe wrote:
> On 2/11/25 2:45 PM, Caleb Sander Mateos wrote:
>> 8e5b3b89ecaf ("io_uring: remove struct io_tw_state::locked") removed the
>> only field of io_tw_state but kept it as a task work callback argument
>> to "forc[e] users not to invoke them carelessly out of a wrong context".
>> Passing the struct io_tw_state * argument adds a few instructions to all
>> callers that can't inline the functions and see the argument is unused.
>>
>> So pass struct io_tw_state by value instead. Since it's a 0-sized value,
>> it can be passed without any instructions needed to initialize it.
>>
>> Also add a comment to struct io_tw_state to explain its purpose.
> 
> This is nice, reduces the code generated. It'll conflict with the
> fix that Pavel posted, but I can just mangle this one once I get
> the 6.15 branch rebased on top of -rc3. No need to send a v2.

Hold on this one, we're better to adjust the patch, I'll
follow up later today.

-- 
Pavel Begunkov


  reply	other threads:[~2025-02-12 14:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-11 21:45 [PATCH] io_uring: pass struct io_tw_state by value Caleb Sander Mateos
2025-02-12 13:31 ` Pavel Begunkov
2025-02-12 14:33 ` Jens Axboe
2025-02-12 14:49   ` Pavel Begunkov [this message]
2025-02-12 14:50     ` Jens Axboe
2025-02-13 16:54 ` Pavel Begunkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b478f8fd-d43b-429c-aa6c-1b94951421ab@gmail.com \
    --to=asml.silence@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=csander@purestorage.com \
    --cc=io-uring@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox