public inbox for [email protected]
 help / color / mirror / Atom feed
* [RFC] io_uring: enable shmem/memfd memory registration
@ 2021-06-09 14:26 Pavel Begunkov
  2021-06-09 15:12 ` Jens Axboe
  0 siblings, 1 reply; 4+ messages in thread
From: Pavel Begunkov @ 2021-06-09 14:26 UTC (permalink / raw)
  To: Jens Axboe, io-uring

Relax buffer registration restictions, which filters out file backed
memory, and allow shmem/memfd as they have normal anonymous pages
underneath.

Signed-off-by: Pavel Begunkov <[email protected]>
---
 fs/io_uring.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index 44d1859f0dfb..e980695707ec 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -8300,6 +8300,8 @@ static int io_sqe_buffer_register(struct io_ring_ctx *ctx, struct iovec *iov,
 		for (i = 0; i < nr_pages; i++) {
 			struct vm_area_struct *vma = vmas[i];
 
+			if (vma_is_shmem(vma))
+				continue;
 			if (vma->vm_file &&
 			    !is_file_hugepages(vma->vm_file)) {
 				ret = -EOPNOTSUPP;
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [RFC] io_uring: enable shmem/memfd memory registration
  2021-06-09 14:26 [RFC] io_uring: enable shmem/memfd memory registration Pavel Begunkov
@ 2021-06-09 15:12 ` Jens Axboe
  2021-06-14  0:45   ` Pavel Begunkov
  0 siblings, 1 reply; 4+ messages in thread
From: Jens Axboe @ 2021-06-09 15:12 UTC (permalink / raw)
  To: Pavel Begunkov, io-uring

On 6/9/21 8:26 AM, Pavel Begunkov wrote:
> Relax buffer registration restictions, which filters out file backed
> memory, and allow shmem/memfd as they have normal anonymous pages
> underneath.

I think this is fine, we really only care about file backed.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC] io_uring: enable shmem/memfd memory registration
  2021-06-09 15:12 ` Jens Axboe
@ 2021-06-14  0:45   ` Pavel Begunkov
  2021-06-15 21:58     ` Jens Axboe
  0 siblings, 1 reply; 4+ messages in thread
From: Pavel Begunkov @ 2021-06-14  0:45 UTC (permalink / raw)
  To: Jens Axboe, io-uring

On 6/9/21 4:12 PM, Jens Axboe wrote:
> On 6/9/21 8:26 AM, Pavel Begunkov wrote:
>> Relax buffer registration restictions, which filters out file backed
>> memory, and allow shmem/memfd as they have normal anonymous pages
>> underneath.
> 
> I think this is fine, we really only care about file backed.

Jens, can you append a tag?

Reported-by: Mahdi Rakhshandehroo <[email protected]>

-- 
Pavel Begunkov

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC] io_uring: enable shmem/memfd memory registration
  2021-06-14  0:45   ` Pavel Begunkov
@ 2021-06-15 21:58     ` Jens Axboe
  0 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2021-06-15 21:58 UTC (permalink / raw)
  To: Pavel Begunkov, io-uring

On 6/13/21 6:45 PM, Pavel Begunkov wrote:
> On 6/9/21 4:12 PM, Jens Axboe wrote:
>> On 6/9/21 8:26 AM, Pavel Begunkov wrote:
>>> Relax buffer registration restictions, which filters out file backed
>>> memory, and allow shmem/memfd as they have normal anonymous pages
>>> underneath.
>>
>> I think this is fine, we really only care about file backed.
> 
> Jens, can you append a tag?
> 
> Reported-by: Mahdi Rakhshandehroo <[email protected]>

I can't, it's sitting pretty deep at this point...

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-06-15 21:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-09 14:26 [RFC] io_uring: enable shmem/memfd memory registration Pavel Begunkov
2021-06-09 15:12 ` Jens Axboe
2021-06-14  0:45   ` Pavel Begunkov
2021-06-15 21:58     ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox