public inbox for [email protected]
 help / color / mirror / Atom feed
From: Pavel Begunkov <[email protected]>
To: Keith Busch <[email protected]>
Cc: Keith Busch <[email protected]>,
	[email protected], [email protected],
	[email protected], [email protected]
Subject: Re: [PATCH 6/6] io_uring: cache nodes and mapped buffers
Date: Sat, 8 Feb 2025 14:24:37 +0000	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <Z6Yt3o7LKtVdFx32@kbusch-mbp>

On 2/7/25 15:59, Keith Busch wrote:
> On Fri, Feb 07, 2025 at 12:41:17PM +0000, Pavel Begunkov wrote:
>> On 2/3/25 15:45, Keith Busch wrote:
>>> +struct io_alloc_cache {
>>> +	void			**entries;
>>> +	unsigned int		nr_cached;
>>> +	unsigned int		max_cached;
>>> +	size_t			elem_size;
>>> +};
>>> +
>>>    struct io_buf_table {
>>>    	struct io_rsrc_data	data;
>>> +	struct io_alloc_cache	node_cache;
>>> +	struct io_alloc_cache	imu_cache;
>>
>> We can avoid all churn if you kill patch 5/6 and place put the
>> caches directly into struct io_ring_ctx. It's a bit better for
>> future cache improvements and we can even reuse the node cache
>> for files.
> 
> I had this that way in an earlier version. The cache is tightly
> connected to the buf table, though, so splitting them up makes for some
> awkward cleanup. Grouping them together makes it clear their lifetimes
> are as a single unit.

I'd say it's tightly couple with the context as depends on the
ctx sync, and the table doesn't really care from where memory
comes.

Anyway, there are basically two reasons. If we're adding node cache,
we need to reuse it for files as well. And I'll likely need to pull
it all back to ctx for cleaning up caches in general, and I'd rather
avoid such back and forths as it's not so great for backports and
things like that.

Is there a good reason why it needs to be in there?


> The filetable could have moved its bitmap into io_ring_ctx too, but it's
> in its own structure like this, and it conceptually makes sense. This is
> following in that same pattern.

-- 
Pavel Begunkov


  reply	other threads:[~2025-02-08 14:24 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-03 15:45 [PATCH 0/6] ublk zero-copy support Keith Busch
2025-02-03 15:45 ` [PATCH 1/6] block: const blk_rq_nr_phys_segments request Keith Busch
2025-02-03 15:45 ` [PATCH 2/6] io_uring: use node for import Keith Busch
2025-02-03 15:45 ` [PATCH 3/6] io_uring: add support for kernel registered bvecs Keith Busch
2025-02-07 14:08   ` Pavel Begunkov
2025-02-07 15:17     ` Keith Busch
2025-02-08 15:49       ` Pavel Begunkov
2025-02-10 14:12   ` Ming Lei
2025-02-10 15:05     ` Keith Busch
2025-02-03 15:45 ` [PATCH 4/6] ublk: zc register/unregister bvec Keith Busch
2025-02-08  5:50   ` Ming Lei
2025-02-03 15:45 ` [PATCH 5/6] io_uring: add abstraction for buf_table rsrc data Keith Busch
2025-02-03 15:45 ` [PATCH 6/6] io_uring: cache nodes and mapped buffers Keith Busch
2025-02-07 12:41   ` Pavel Begunkov
2025-02-07 15:33     ` Keith Busch
2025-02-08 14:00       ` Pavel Begunkov
2025-02-07 15:59     ` Keith Busch
2025-02-08 14:24       ` Pavel Begunkov [this message]
2025-02-06 15:28 ` [PATCH 0/6] ublk zero-copy support Keith Busch
2025-02-07  3:51 ` Ming Lei
2025-02-07 14:06   ` Keith Busch
2025-02-08  5:44     ` Ming Lei
2025-02-08 14:16       ` Pavel Begunkov
2025-02-08 20:13         ` Keith Busch
2025-02-08 21:40           ` Pavel Begunkov
2025-02-08  7:52     ` Ming Lei
2025-02-08  0:51 ` Bernd Schubert

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] \
    [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