From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DC89C3DC4C9 for ; Wed, 6 May 2026 09:02:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778058151; cv=none; b=OW64lZTmMlMYPLt9zFPjATlCOMBNGCcf2MiXTm/VG2AX4PTsJrH0fHPP30SEBWCQV1thv5bWpKPLpX/UjJcgFqLtNfqzsux6gINlYDLToc1/oLulJtrdHAz/+52w7M83O7j29klMODYdUXcFbH1/FHXHKQQ2xJRqcnOTDnm60pg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778058151; c=relaxed/simple; bh=nLSZKCR0woXtN6W5cyzs5oEHO2Ts0XPwdeXwd60CnUg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=ZV2aHYLiCjFT31FYB57wfuoyx/le5os2r0I/zRnGJtqAU2h+PqNaATH67KdZd0XQp7QdK4+aNAwK6RYPKThTmO77URSeLwuWH9WD6mhatfVw1DGLI8BkQr6WEv1zxzepVuBsLQ9dCUKhcZ77DWz7AwmMq5hBpqeihOcsU3ZWzek= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=KGAPdKzL; arc=none smtp.client-ip=209.85.128.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KGAPdKzL" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-4896c22fcbaso47202475e9.0 for ; Wed, 06 May 2026 02:02:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778058143; x=1778662943; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=mmaZWXsqMxYY1SXzoardDG6u5dyIRaJ/iULJJHwbN+E=; b=KGAPdKzLk3vJJ86/+9JWb0pewVd+eSoidY3lk7EZPts94uHo4N/VRkoM9t57Na8hZU ohCDqtJlErkxUgfhc1xF31gaTTxEEV9aQTpYdnIYJw5UqkLIvfOYXMVeC0yFRnX/MHe4 HmgeTl6uAbvaO7lSltkxovg9zHAEVQVtWdlJLq+MyigLOHJOPN3xooUX/QlPsg9aezCX fcFIH2ULFXdTlkzGp+Ry1SgKQ1i2euO26Gf6Maw6yBVWA69E1LILuSHMu5h7drw4GBsF YHnLv0r1kzhMzpzHNEVk53axTY4nfGL7MMB052P2FX+fuI9Xsu9HaT6ntUkADcXIzcaX fiPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778058143; x=1778662943; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=mmaZWXsqMxYY1SXzoardDG6u5dyIRaJ/iULJJHwbN+E=; b=kyoxsUEiBtE5dHCpla2LAxVEmxC0US8MovDYiwq14elS1uIDd6JHs9l+glVCZwJJ1t 7vrGsYeQ6KvjAqaEFaHu0HzntzmsbrvC28+3EVkgdZs24FhH0sd77TvyxVoYexWMR8KU CPvchaz4Ehiux8gnPJWTmmGaMt9ttmDKbCbtczV3RQWp/ynwtXwhBbAkB/fHSJyb0KaF v/gZBgCOXEUdFB63qjYsCcyxsWVDcdGMEnxVopsCyY6YAvw2fwR3QYZHR/KBS7zQtbXs kBV6cBztZ6Mgb3zN1dfWzHrQfELBYq+viPjQZk63mtVqKssS+tfzhEDBewqGdHmjnSq9 ZzyA== X-Forwarded-Encrypted: i=1; AFNElJ+LDKPfu0aELtJJ1GqNgkhBD9ngRDCZwMYjUB6oLNuSPC2n4LZDS8soCTbSQthr2uGXH9Z/wRZ1uUpcA7Zy@vger.kernel.org X-Gm-Message-State: AOJu0YyLJIpEBNg6Fke6FieHMlshQrDvXNMv8UrRxvxAHcB+RdsgOINw bXOz3j2Fq4qwVunBcA/hWLdL/0/gn3Y+8pr6uFN3e7xQTpsdmPt2ddFO X-Gm-Gg: AeBDietRp1I4Hium6kR6ZB3iiyfPGN77Rpg+uifGxPX4lah1IlbTPYz0gY23z5ypDB7 uyWvkde7sDQDsUlgbZwnhlTiiwXYaXiciuPRvPxV5u2/HpTiW5y23wkiyUD6E9Xu9OT+2V9hZ/R yPKJidC0C1yHpV2Nu7bNoUsC4aTswWaOyW0zkKU+QCwOw/sdGstWXjdD5cRJMtvnHSl/fs6vhSN yg5q1AZuNIqA386dEXHq66st5UA3iUV7rUfply+dxhKHOz71db7tPsfgr+M77MMWqYuxnV1E8BT vqFXiVkbC5XAz1oagyIXdtvFkQMXy1UXrO/xcE9nNtZFJHKBToG5sMu8RM4Z6yQeHWVLspvcQzT pNeIjhTUKYB11OxUg8RE73mtwfyeJHcc9xoQzlBT8g/HrztZZ7HwNhGIbqbiumZjZDUyPzm9uV7 jjs7SMKYQrtHPi3CDKAb24fJrE34j7+jDera4OMi+l7xOo1LNb8OT7Z/9+1y50mH3AfyF6qTWju HagEvKVD9daxo11pVJ4Tfeirz6gsAhR6mWE6VzfXw== X-Received: by 2002:a05:600c:2e0c:b0:489:1c2d:211e with SMTP id 5b1f17b1804b1-48e51e0c833mr25734095e9.5.1778058142476; Wed, 06 May 2026 02:02:22 -0700 (PDT) Received: from [10.109.92.22] ([86.33.71.194]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48e52f5c1cfsm21365215e9.0.2026.05.06.02.02.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 06 May 2026 02:02:21 -0700 (PDT) Message-ID: <6873d617-c904-45f3-bad9-e1ae39cfecd2@gmail.com> Date: Wed, 6 May 2026 10:02:11 +0100 Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 00/10] Add dmabuf read/write via io_uring To: Ming Lei Cc: Jens Axboe , Keith Busch , Christoph Hellwig , Sagi Grimberg , Alexander Viro , Christian Brauner , Andrew Morton , Sumit Semwal , =?UTF-8?Q?Christian_K=C3=B6nig?= , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-fsdevel@vger.kernel.org, io-uring@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, Nitesh Shetty , Kanchan Joshi , Anuj Gupta , Tushar Gohad , William Power , Phil Cayton , Jason Gunthorpe References: Content-Language: en-US From: Pavel Begunkov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hey Ming, On 5/4/26 16:29, Ming Lei wrote: > On Wed, Apr 29, 2026 at 04:25:46PM +0100, Pavel Begunkov wrote: >> The patch set allows to register a dmabuf to an io_uring instance for >> a specified file and use it with io_uring read / write requests. The >> infrastructure is not tied to io_uring and there could be more users >> in the future. A similar idea was attempted some years ago by Keith [1], >> from where I borrowed a good number of changes, and later was brough up >> by Tushar and Vishal from Intel. >> >> It's an opt-in feature for files, and they need to implement a new >> file operation to use it. Only NVMe block devices are supported in this >> series. The user API is built on top of io_uring's "registered buffers", >> where a dmabuf is registered in a special way, but after it can be used >> as any other "registered buffer" with IORING_OP_{READ,WRITE}_FIXED >> requests. It's created via a new file operation and the resulted map is >> then passed through the I/O stack in a new iterator type. There is some >> additional infrastructure to bind it all, which also counts requests >> using a dmabuf map and managing lifetimes, which is used to implement >> map invalidation. >> >> It was tested for GPU <-> NVMe transfers. Also, as it maintains a >> long-term dma mapping, it helps with the IOMMU cost. The numbers >> below are for udmabuf reads previously run by Anuj for different >> IOMMU modes: > > Plain registered buffer is long-live too, which raises question: does this > framework need to take it into account from beginning? Not sure I follow, mind expanding on what should be accounted? Are you suggesting that we might want to use normal registered buffers in a similar way? I.e. giving the driver an ability to pre-register them? > BTW, inspired by this approach, I adds similar feature to ublk via UBLK_IO_F_SHMEM_ZC > which can maintain long-term vfio dma mapping over registered user-place aligned buffer. Interesting, just too a glance, and it looks like what David Wei was thinking to add to fuse, but IIUC he gave up exactly because the client will need to cooperate and that could be troublesome. Should we try to push everything under the same interface instead of keeping a ublk specific one? Again to the point that it requires a cooperative client, but if it's something more generic, the user might just try to use it as a general optimisation. In the same way it'll be helpful to fuse, and as a bonus you wouldn't need tree look ups (but mandates clients using registered buffers as a downside). It'd need to shaped to somehow work better with host memory as I assume you want to be able to map it into server in common case. Switch case'ing if it's a udmabuf is not the greatest approach, but maybe we can figure out something else. -- Pavel Begunkov