Linux io-uring development
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Bernd Schubert <bernd.schubert@fastmail.fm>, io-uring@vger.kernel.org
Cc: Pavel Begunkov <asml.silence@gmail.com>,
	Miklos Szeredi <miklos@szeredi.hu>,
	Joanne Koong <joannelkoong@gmail.com>,
	Josef Bacik <josef@toxicpanda.com>
Subject: Re: Large CQE for fuse headers
Date: Fri, 11 Oct 2024 13:24:07 -0600	[thread overview]
Message-ID: <136d1b08-81fc-4446-b5ed-7db6f8b5dc5b@kernel.dk> (raw)
In-Reply-To: <69b6d3e2-28a1-4055-9b4f-b34d11f77dfc@fastmail.fm>

On 10/11/24 1:03 PM, Bernd Schubert wrote:
>>
>> Curious, what's all the space needed for?
> 
> The basic fuse header: struct fuse_in_header -> current 40B
> and per request header headers, I think current max is 64.
> 
> And then some extra compat space for both, so that they can be safely
> extended in the future (which is currently an issue).

So that's 104b, and regular CQE stuff too I presume, so that's 104+16 ==
120 bytes. That'd fit in a 128b CQE, and 256b would be pleeeeenty? Just
squeeze a version field or something in there so you know what the
version is for future proofing? I would strongly recommend making it as
large as you need it for those things, but no longer just for
compat/future reasons. Eg 128b over 256b is a win for sure, and 256b
over 512b is a REALLY nice win.

>>>> Since this obviously means larger CQ rings, one nice side effect is that
>>>> since 6.10 we don't need contig pages to map any of the rings. So should
>>>> work just fine regardless of memory fragmentation, where previously that
>>>> would've been a concern.
>>>>
>>>
>>> Out of interest, what is the change? Up to fuse-io-uring rfc2 I was
>>> vmalloced buffers for fuse that got mmaped - was working fine. Miklos just
>>> wants to avoid that kernel allocates large chunks of memory on behalf of
>>> users.
>>
>> It was the change that got rid of remap_pfn_range() for mapping, and
>> switched to vm_insert_page(s) instead. Memory overhead should generally
>> not be too bad, it's all about sizing the rings appropriately. The much
>> bigger concern is needing contig memory, as that can become scarce after
>> longer uptimes, even with plenty of memory free. This is particularly
>> important if you need 512b CQEs, obviously.
>>
> 
> For sure, I was just curious what you had changed. I think I had looked into
> that io-uring code around 2 years ago.  Going to look into the update
> io-uring code, thanks for the hint.
> For fuse I was just using remap_vmalloc_range().
> 
> https://lore.kernel.org/all/20240529-fuse-uring-for-6-9-rfc2-out-v1-7-d149476b1d65@ddn.com/

That's the one to use, io_uring was just stuck with using the wrong API
for quite a while, but that got sorted.

-- 
Jens Axboe

  reply	other threads:[~2024-10-11 19:24 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-10 20:56 Large CQE for fuse headers Bernd Schubert
2024-10-11 17:57 ` Jens Axboe
2024-10-11 18:35   ` Bernd Schubert
2024-10-11 18:39     ` Jens Axboe
2024-10-11 19:03       ` Bernd Schubert
2024-10-11 19:24         ` Jens Axboe [this message]
2024-10-11 21:38 ` Pavel Begunkov
2024-10-12  1:55 ` Ming Lei
2024-10-12 14:38   ` Jens Axboe
2024-10-13 21:20     ` Bernd Schubert
2024-10-14  2:44       ` Ming Lei
2024-10-14 11:10         ` Miklos Szeredi
2024-10-14 12:47           ` Bernd Schubert
2024-10-14 13:34             ` Pavel Begunkov
2024-10-14 15:21               ` Bernd Schubert
2024-10-14 17:48                 ` Pavel Begunkov
2024-10-14 21:27                   ` Bernd Schubert
2024-10-16 10:54                     ` Miklos Szeredi
2024-10-16 11:53                       ` Bernd Schubert
2024-10-16 12:24                         ` Miklos Szeredi
2024-10-17  0:59                         ` Ming Lei
2024-10-14 13:20           ` Bernd Schubert
2024-10-14 10:31       ` Miklos Szeredi

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=136d1b08-81fc-4446-b5ed-7db6f8b5dc5b@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=asml.silence@gmail.com \
    --cc=bernd.schubert@fastmail.fm \
    --cc=io-uring@vger.kernel.org \
    --cc=joannelkoong@gmail.com \
    --cc=josef@toxicpanda.com \
    --cc=miklos@szeredi.hu \
    /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