public inbox for [email protected]
 help / color / mirror / Atom feed
From: Jens Axboe <[email protected]>
To: [email protected]
Subject: [PATCHSET 0/4 v2] Support for mapping SQ/CQ rings into huge page
Date: Sat, 13 May 2023 08:16:39 -0600	[thread overview]
Message-ID: <[email protected]> (raw)

Hi,

io_uring SQ/CQ rings are allocated by the kernel from contigious, normal
pages, and then the application mmap()'s the rings into userspace. This
works fine, but does require contigious pages to be available for the
given SQ and CQ ring sizes. As uptime increases on a given system, so
does memory fragmentation. Entropy is invevitable.

This patchset adds support for the application passing in a pre-allocated
huge page, and then placing the rings in that. This reduces the need for
contigious pages, and also reduces the TLB pressure for larger rings.

The liburing huge.2 branch has support for using this trivially.
Applications may use the normal ring init helpers and set
IORING_SETUP_NO_MMAP, in which case a huge page will get allocated for
them and used. Or they may use io_uring_queue_init_mem() and pass in
a pre-allocated huge page, getting the amount of it used returned. This
allows placing multiple rings into a single huge page.

Changes since v1:
- Mandate that we're using a single page. May be a normal page if we
  don't need a lot of memory, or a huge page if the ring itself takes
  up more space than a single normal page.

-- 
Jens Axboe



             reply	other threads:[~2023-05-13 14:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-13 14:16 Jens Axboe [this message]
2023-05-13 14:16 ` [PATCH 1/4] io_uring: remove sq/cq_off memset Jens Axboe
2023-05-13 14:16 ` [PATCH 2/4] io_uring: return error pointer from io_mem_alloc() Jens Axboe
2023-05-14  2:54   ` Dmitry Kadashev
2023-05-14  2:59     ` Jens Axboe
2023-05-13 14:16 ` [PATCH 3/4] io_uring: add ring freeing helper Jens Axboe
2023-05-13 14:16 ` [PATCH 4/4] io_uring: support for user allocated memory for rings/sqes Jens Axboe

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