From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (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 6E7323DEAFF for ; Wed, 6 May 2026 09:02:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778058151; cv=none; b=WeKuujeZADLKXTV+vJOl1T0lVQHXPYVOffupJZnO2KwG/xQ1Xq1ZQHZcXRLk9834ca3hTkN74hJc7rQ8ZXekZXFJQOpxEucEwpnCESwwVVSgFhc+qqG/YcsJiOAbyGdJ0HOJKgbU7YG8IUQkbdlbaC+p4YcjrWbK58ZczWJaKrk= 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.47 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-f47.google.com with SMTP id 5b1f17b1804b1-48e56c1bf5dso887955e9.3 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=XFS0209JmeUy6ISNLVjOPmUPs0ByUPkrG30HkCaTITpPjE7JpAzC+U8iy50dX0oWoF A2wfKErfMKqco7Yrtm11mZOqQpOnvYvzwDM85x8E7YE7j9WaSh2etS3nxYTHAQHhevN+ +gXMYYLQXVfxLO6WFyCYb8cpNGkDiEekaP3qluAA30kV2filcH0Z0pntebszmflX5hoj gaizu/GKsPPw0wu865y0gI+cB1pSBb681oFk0ZqLqiZGHgbEQxzdj+C69ApVkJYj2o4P gHj8+mJuww0e5fhUq+TRcOMpxbKO5nxv4XyLkbj6lbNO6GWIFsvNGQlTDRZfx5/TJjQe jCTQ== X-Forwarded-Encrypted: i=1; AFNElJ9S3VKHAMXCjnGxsLBcxVNzgsx/YqjraBOOlvogWY7v6MZ8+4jKvfc2iTjeMsTlD50Scig0qUkC1rZGRKY=@vger.kernel.org X-Gm-Message-State: AOJu0Yyuk4OrPiMTVceFiEOtibRC9SX7lmliDjZ0ENM8njszRjTw/znN BA4zbQYf9QGfbRppchn0pbX+oSZYHoHRapVm50ufqmvwY9uinpnpOIPb X-Gm-Gg: AeBDietmkl8v9mAq4H3RIlnO+GiMoAKWQLbJcXfuORf8Z/umaL+y570ovO6+/zVw8Ve TtmkR0mZepq6JquN7VZWq12S/BBTpLpHjCiHo/xUAUSBUfhn/4JcTlatfVvGBw5XJdPuXSUMFyG K/u1SuSNskabgO8cYU0hDxtZeL1uUM55shC0OFhSG+HkwA3DOCPXA+aKiKnU6SMjrbPH3ZQMP7e jpNpKdUGN2n3q0fxLGHg0QRXMyB3VLNxELFhh0T3sIR+W8MgANZVwZS/KYEzvZm+jQPQdFq7TZ4 gFw2JhWnu0nt0hwneaYXeo/o/U9VefDUKm6Y2AjPiE20abm8pPNNrkhGQEnwXfwUvoGehqChvNX op1iLV+EyAKUbXsxXwr4RYgwxCDzdZhY+85uhupmndq91QDIAq7DPgPZ68fZ1xpduKmrK48oQ5n 4GqHkOAlRJSPhgHjRyoiQZhX7A4d0rqkGyBkbLCpnSYBDkhcGV3rsgtMoGTVT73yspff4V0Dh1A 5IewpgItS7y7YkNBg6iIqo8RucELGDSnouEdLVDCQ== 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-kernel@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