All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: "Clément Léger" <cleger@meta.com>, io-uring <io-uring@vger.kernel.org>
Cc: Andres Freund <andres@anarazel.de>
Subject: Re: [PATCH] io_uring/rsrc: remove registered buffer 1GB limit
Date: Tue, 5 May 2026 07:26:00 -0600	[thread overview]
Message-ID: <4c976ffe-ae16-4804-9b75-50ffb7288d11@kernel.dk> (raw)
In-Reply-To: <0965a131-ccaf-40d5-a207-9d41c837b278@meta.com>

On 5/5/26 7:23 AM, Cl?ment L?ger wrote:
> On 5/5/26 12:09, Jens Axboe wrote:
>> > On 5/5/26 1:39 AM, Jens Axboe wrote:
>>> There's no real reason to have a limit, as the memory is accounted by
>>> the lockmem limits anyway, if any exist. io_pin_pages() will still
>>> restrict the maximum allowed limit per buffer, which is INT_MAX
>>> number of pages. For a 4kb page size system, the limit is 8TB.
>>>
>>> Reported-by: Andres Freund <andres@anarazel.de>
>>> Signed-off-by: Jens Axboe <axboe@kernel.dk>
>>
>> Forgot that I had a prep patch for this one... The branch is here:
>>
>> https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux.git/log/?h=io_uring-reg-buffers
>>
>> and notably the patch before this one is below, which bumps the ->len
>> size of the io_mapped_ubuf. I'll send this out as a proper series later
>> this week, this is 7.2 material obviously.
>>
>> commit 381e736515173a1fb78d2a86983d3ebfcf263597
>> Author: Jens Axboe <axboe@kernel.dk>
>> Date:   Mon May 4 05:40:16 2026 -0600
>>
>>      io_uring/rsrc: bump struct io_mapped_ubuf length field to size_t
>>           In preparation for supporting bigger individual buffers, bump the length
>>      field to a full 8-bytes with size_t rather than an unsigned int.
>>           Signed-off-by: Jens Axboe <axboe@kernel.dk>
>>
>> diff --git a/io_uring/fdinfo.c b/io_uring/fdinfo.c
>> index c2d3e45544bb..f0ff4bd01b6d 100644
>> --- a/io_uring/fdinfo.c
>> +++ b/io_uring/fdinfo.c
>> @@ -223,7 +223,7 @@ static void __io_uring_show_fdinfo(struct io_ring_ctx *ctx, struct seq_file *m)
>>           if (ctx->buf_table.nodes[i])
>>               buf = ctx->buf_table.nodes[i]->buf;
>>           if (buf)
>> -            seq_printf(m, "%5u: 0x%llx/%u\n", i, buf->ubuf, buf->len);
>> +            seq_printf(m, "%5u: 0x%llx/%zu\n", i, buf->ubuf, buf->len);
>>           else
>>               seq_printf(m, "%5u: <none>\n", i);
>>       }
>> diff --git a/io_uring/rsrc.h b/io_uring/rsrc.h
>> index 44e3386f7c1c..03521b50926c 100644
>> --- a/io_uring/rsrc.h
>> +++ b/io_uring/rsrc.h
>> @@ -34,15 +34,15 @@ enum {
>>     struct io_mapped_ubuf {
>>       u64        ubuf;
>> -    unsigned int    len;
>> +    size_t        len;
>>       unsigned int    nr_bvecs;
>>       unsigned int    folio_shift;
>>       refcount_t    refs;
>> +    u8        flags;
>> +    u8        dir;
>>       unsigned long    acct_pages;
>>       void        (*release)(void *);
>>       void        *priv;
>> -    u8        flags;
>> -    u8        dir;
> 
> Hi Jens,
> 
> This seems like an unrelated change.

Hmm, how so? It's required for removing the 1GB restriction, as it bumps
buf->len from a 32-bit unsigned to a 64-bit size_t.

Oh you mean moving flags and dir? That's just so it packs better,
changing int would leave a 4-byte gap. Might as well move flags and dir
near the 4b refcount_t to avoid bloating the struct.

-- 
Jens Axboe

  reply	other threads:[~2026-05-05 13:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-05  7:39 [PATCH] io_uring/rsrc: remove registered buffer 1GB limit Jens Axboe
2026-05-05 10:09 ` Jens Axboe
2026-05-05 13:23   ` Clément Léger
2026-05-05 13:26     ` Jens Axboe [this message]
2026-05-05 13:35       ` Clément Léger
2026-05-05 13:08 ` [syzbot ci] " syzbot ci

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=4c976ffe-ae16-4804-9b75-50ffb7288d11@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=andres@anarazel.de \
    --cc=cleger@meta.com \
    --cc=io-uring@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.