public inbox for [email protected]
 help / color / mirror / Atom feed
From: Jens Axboe <[email protected]>
To: Pavel Begunkov <[email protected]>, [email protected]
Subject: Re: [PATCH 5.9] io_uring: replace rw->task_work with rq->task_work
Date: Mon, 13 Jul 2020 08:11:32 -0600	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

On 7/13/20 2:03 AM, Pavel Begunkov wrote:
> On 12/07/2020 23:29, Jens Axboe wrote:
>> On 7/12/20 11:42 AM, Pavel Begunkov wrote:
>>> io_kiocb::task_work was de-unionised, and is not planned to be shared
>>> back, because it's too useful and commonly used. Hence, instead of
>>> keeping a separate task_work in struct io_async_rw just reuse
>>> req->task_work.
>>
>> This is a good idea, req->task_work is a first class citizen these days.
>> Unfortunately it doesn't do much good for io_async_ctx, since it's so
>> huge with the msghdr related bits. It'd be nice to do something about
>> that too, though not a huge priority as allocating async context is
> 
> We can allocate not an entire struct/union io_async_ctx but its particular
> member. Should be a bit better for writes.

Right, we probably just need to turn req->io into a:

	void *async_ctx;

and have it be assigned with the various types that are needed for
async deferral.

> And if we can save another 16B in io_async_rw, it'd be 3 cachelines for
> io_async_rw. E.g. there are two 4B holes in struct wait_page_queue, one is
> from "int bit_nr", the second is inside "wait_queue_entry_t wait".

An easy 8 bytes is just turning nr_segs and size into 32-bit types. The
size will never be more than 2G, and segs is limited at 1k iirc.

-- 
Jens Axboe


      reply	other threads:[~2020-07-13 14:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-12 17:42 [PATCH 5.9] io_uring: replace rw->task_work with rq->task_work Pavel Begunkov
2020-07-12 20:29 ` Jens Axboe
2020-07-13  8:03   ` Pavel Begunkov
2020-07-13 14:11     ` Jens Axboe [this message]

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 \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /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