public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: io-uring@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH] io_uring: take page references for NOMMU pbuf_ring mmaps
Date: Tue, 21 Apr 2026 19:17:57 -0600	[thread overview]
Message-ID: <dec29d85-9e79-42df-ae3d-9af65134283c@kernel.dk> (raw)
In-Reply-To: <177679318887.642042.703437019420919449.b4-ty@b4>

On 4/21/26 11:39 AM, Jens Axboe wrote:
> 
> On Tue, 21 Apr 2026 15:46:16 +0200, Greg Kroah-Hartman wrote:
>> Under !CONFIG_MMU, io_uring_get_unmapped_area() returns the kernel
>> virtual address of the io_mapped_region's backing pages directly;
>> the user's VMA aliases the kernel allocation. io_uring_mmap() then
>> just returns 0 -- it takes no page references.
>>
>> The CONFIG_MMU path uses vm_insert_pages(), which takes a reference on
>> each inserted page.  Those references are released when the VMA is torn
>> down (zap_pte_range -> put_page). io_free_region() -> release_pages()
>> drops the io_uring-side references, but the pages survive until munmap
>> drops the VMA-side references.
>>
>> [...]
> 
> Applied, thanks!
> 
> [1/1] io_uring: take page references for NOMMU pbuf_ring mmaps
>       commit: d9b7b3d9c5286a786c7fe8220c55a6e012088c2e

Actually, I take that back - what prevents the io_mmap_get_region()
in the newly added io_uring_nommu_vm_close() from getting the same
region that we initially referenced the pages from in the nommu
variant of io_uring_mmap()?

-- 
Jens Axboe


  reply	other threads:[~2026-04-22  1:18 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-21 13:46 [PATCH] io_uring: take page references for NOMMU pbuf_ring mmaps Greg Kroah-Hartman
2026-04-21 13:50 ` Jens Axboe
2026-04-21 13:55   ` Greg Kroah-Hartman
2026-04-21 14:02     ` Jens Axboe
2026-04-21 16:01     ` Greg Kroah-Hartman
2026-04-21 16:05       ` Jens Axboe
2026-04-21 16:21         ` Jens Axboe
2026-04-21 16:24           ` Greg Kroah-Hartman
2026-04-21 16:41             ` Jens Axboe
2026-04-21 17:04               ` Jens Axboe
2026-04-21 17:38                 ` Jens Axboe
2026-04-21 17:39 ` Jens Axboe
2026-04-22  1:17   ` Jens Axboe [this message]
2026-04-22  1:56     ` Jens Axboe
2026-04-22  2:26       ` 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 \
    --in-reply-to=dec29d85-9e79-42df-ae3d-9af65134283c@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=gregkh@linuxfoundation.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox