From: Jeff Moyer <[email protected]>
To: Gabriel Krisman Bertazi <[email protected]>
Cc: [email protected], [email protected]
Subject: Re: [PATCH] io_uring: Use slab for struct io_buffer objects
Date: Thu, 07 Sep 2023 14:55:27 -0400 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]> (Gabriel Krisman Bertazi's message of "Tue, 29 Aug 2023 20:36:34 -0400")
Hi, Gabriel,
I just have a couple of comments. I don't have an opinion on whether it
makes sense to replace the existing allocator.
-Jeff
> @@ -362,11 +363,12 @@ int io_provide_buffers_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe
> return 0;
> }
>
> +#define IO_BUFFER_ALLOC_BATCH (PAGE_SIZE/sizeof(struct io_buffer))
> +
> static int io_refill_buffer_cache(struct io_ring_ctx *ctx)
> {
> - struct io_buffer *buf;
> - struct page *page;
> - int bufs_in_page;
> + struct io_buffer *bufs[IO_BUFFER_ALLOC_BATCH];
That's a pretty large on-stack allocation.
> + allocated = kmem_cache_alloc_bulk(io_buf_cachep, GFP_KERNEL_ACCOUNT,
> + ARRAY_SIZE(bufs), (void **) bufs);
> + if (unlikely(allocated <= 0)) {
Can't be less than 0.
next prev parent reply other threads:[~2023-09-07 18:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-30 0:36 [PATCH] io_uring: Use slab for struct io_buffer objects Gabriel Krisman Bertazi
2023-09-07 18:39 ` Gabriel Krisman Bertazi
2023-09-07 18:55 ` Jeff Moyer [this message]
2023-09-08 1:30 ` Gabriel Krisman Bertazi
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] \
/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