public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
From: Pavel Begunkov <asml.silence@gmail.com>
To: Anuj Gupta <anuj1072538@gmail.com>
Cc: kbusch@kernel.org, hch@lst.de, sagi@grimberg.me, axboe@kernel.dk,
	joshi.k@samsung.com, linux-nvme@lists.infradead.org,
	linux-block@vger.kernel.org, io-uring@vger.kernel.org,
	Anuj Gupta <anuj20.g@samsung.com>
Subject: Re: [PATCH] nvme/io_uring: enable dma-buf backed passthrough I/O
Date: Wed, 21 Oct 2026 15:23:09 +0100	[thread overview]
Message-ID: <d0c8cc97-6a21-4c64-b55d-16af783fdb59@gmail.com> (raw)
In-Reply-To: <vx4ugjq6wol6elipmwkuhtpk3qnanpwou6g73dxrjona3nepd4@pvetkgijfsx5>

Hi Anuj,

On 10/19/26 14:40, Anuj Gupta wrote:
> On Sun, Oct 18, 2026 at 11:06:16PM +0100, Pavel Begunkov wrote:
>> On 10/16/26 11:34, Anuj Gupta wrote:
>>> From: Anuj Gupta <anuj20.g@samsung.com>
>>> diff --git a/drivers/nvme/host/ioctl.c b/drivers/nvme/host/ioctl.c
>>> index 3aa5d2f2dfbb..6343da1f6c05 100644
>>> --- a/drivers/nvme/host/ioctl.c
>>> +++ b/drivers/nvme/host/ioctl.c
>>> @@ -458,6 +458,7 @@ static enum rq_end_io_ret nvme_uring_cmd_end_io(struct request *req,
>>>    			status = blk_status_to_errno(err);
>>>    	}
>>>    	io_uring_cmd_set_res32(ioucmd, status, result);
>>> +	io_uring_cmd_detach_dmabuf(ioucmd);
>>
>> It's not great spilling the responsibility for [de,a]ttaching
>> between nvme and uring_cmd code. Is there a way to stash it
>> all under io_uring?
> 
> The natural place would be __io_uring_cmd_done(), but that runs from
> task_work, while the ref has to be dropped at hardware completion, like
> io_complete_rw() does.

It may queue a task work but is called from whenever. It would work
if we drop there and in __io_uring_cmd_do_in_task(), but I agree
with you that it might be confusing to the user.

> Hooking io_uring_cmd_do_in_task_lazy() would avoid changing the NVMe
> call site, but would add a non-obvious side effect to a generic
> task_work helper. How about a separate helper that drivers call from
> end_io instead? This keeps the dma-buf handling in io_uring while NVMe
> only reports that it has finished accessing the data.

Sounds the same, but I don't have a better answer, so either is
fine with me. At least with your versions we can add a warning
for misbehaving users.

-- 
Pavel Begunkov


      reply	other threads:[~2026-10-21 14:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-16 10:34 [PATCH] nvme/io_uring: enable dma-buf backed passthrough I/O Anuj Gupta
2026-10-16 10:41 ` Anuj gupta
2026-10-16 12:28 ` Christoph Hellwig
2026-10-18 22:06 ` Pavel Begunkov
2026-10-19 13:40   ` Anuj Gupta
2026-10-21 14:23     ` Pavel Begunkov [this message]

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=d0c8cc97-6a21-4c64-b55d-16af783fdb59@gmail.com \
    --to=asml.silence@gmail.com \
    --cc=anuj1072538@gmail.com \
    --cc=anuj20.g@samsung.com \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=io-uring@vger.kernel.org \
    --cc=joshi.k@samsung.com \
    --cc=kbusch@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /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