Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp2348279rwi; Thu, 3 Nov 2022 16:08:31 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4t4uxeTIdTUqjFGaSmKUK+wuNfP4m38OlJr3UkAZuR4ShiG3zmrKGzRZk3U5o4mDFWhmKX X-Received: by 2002:a17:906:6a17:b0:794:f0e8:1918 with SMTP id qw23-20020a1709066a1700b00794f0e81918mr31832361ejc.474.1667516911802; Thu, 03 Nov 2022 16:08:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667516911; cv=none; d=google.com; s=arc-20160816; b=WgKsUtJMThWafdOJiKMUj5Pfs5Z1PLPMJG1210TmxavciKgnnGlfRPNNpL0yCLEdyu f3TvkzpsyiQlRAVsknuvZA8N88Hh3Xq3t1XcJ+iKfv9DqoBYPfo7s9nFmLWewKa0Yftx eiStBt02Ql8S+R8nlGj+OuyLaMZbL7N7mHnxjrMRjqjogFSQJmiKTFP8TtysAzmkjluV JXBz0yp7nAZ4c6Nl0ODRFLvBL9yShJPEcRNXRWiJiZqO2T2b6FM7qGpOqfxJH+Mzp3ov PPhsSc/1M52h715TvmyiFuTsfAmGT4OZySaEUQnkIUC9yuzyz9DpzPnIukGl9Yn+G43O yqcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:feedback-id:dkim-signature:dkim-signature; bh=r4LfooITf3nrWSMnfNB3pZa38Xa+sKbxYRKtKCOW6Os=; b=KFh/eH+11pQfSvh496gBmkrUPyL+JKreMgitToLmZT9VlB9iPRpqgi2ELSVHrG/s4y PbPZASsz5GNisPZXHlCksOzqlWSzSA9DmF/W9RUZHHkD3LKVNvLNJhmyot9o0ZLkvZtW M2ujjuAXJl5dksvGy0sr4W/3+NlEcNQjE2gEda96/pAKSj7hO/SKG2jRYaeTtbxlnPsr KAPuM6rfCY9CZ3quUB3O++CNM3CaFKWYDWDrDZbDTBJGspor8qkvZCuWcxiWmI7l5WSG XtWS3Ctj4bJ1d6Y6tJYn4y6ck3JIFximejGwh8dVMmBCw8whCAF2JuXG4gKC518Fb+tB Wt5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fastmail.fm header.s=fm1 header.b=Au4HkFYk; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=pCZyMb7r; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fastmail.fm Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i7-20020a50fc07000000b00463d1e2639fsi2233860edr.363.2022.11.03.16.08.08; Thu, 03 Nov 2022 16:08:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@fastmail.fm header.s=fm1 header.b=Au4HkFYk; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=pCZyMb7r; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fastmail.fm Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231804AbiKCW3O (ORCPT + 97 others); Thu, 3 Nov 2022 18:29:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231761AbiKCW2n (ORCPT ); Thu, 3 Nov 2022 18:28:43 -0400 Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC83A2229C; Thu, 3 Nov 2022 15:28:33 -0700 (PDT) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 41F055C00B4; Thu, 3 Nov 2022 18:28:33 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 03 Nov 2022 18:28:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; t=1667514513; x= 1667600913; bh=r4LfooITf3nrWSMnfNB3pZa38Xa+sKbxYRKtKCOW6Os=; b=A u4HkFYkD9K2yM9S4x/crbVwrJVxIdrWw9ItMx2xZbhoIoJo+3az8+kHU44lBfcbq f2P/+Ny8ECj/v3A4cDHWciPyESQcfmJw7ftog+l+vq+SYCNKv9EmQHSYd/yXEede Rae4/3rsSO2DR75rtReyG73/ndXBl2lMHfV+xJgn0RuqHwIrBZz8JhlOymaWgkUR qKcSOAnqrevgtByKiWKtZJ2GOOYlqRH2U5GqcAJiloUxIgkArfFf2PjFztNnt3MU lWYF9iEaXgovwmVTX9gkJ2PEwy1cMZdwR+QR4CqowP13Z+UJKoHYOQoM/qvJIpFY aagiJKUeNAU+q/XGabf6Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1667514513; x= 1667600913; bh=r4LfooITf3nrWSMnfNB3pZa38Xa+sKbxYRKtKCOW6Os=; b=p CZyMb7rEklW13nCcpezstiy2rXbINw+KSA6ZCd7xFX0wRcu6ii9eOxTm4nQVi0rC gc2ks2mIk4OFaaNmT+NPxbYK26EjxNJ3P/wnRW+9O/YmIGiFciGHLZx0H38Q6yOK rGPPpN9HCZGPBLSXlHmj5Ln1V+moUrIFkMDY7vfnUdOOZJ7d2a/TQ6ho3GleNa2e UBzThi1FiTJEUTNLaSATfLCAXTFgeuZxVrSxl0ovPlc+NeNy32b28pvRs08c3e00 2EeUvdJq41X8yAvDqcyz9j15T4uRD8OeKEsvZZgRf68ah1lr0S4WBN48TvBK0GPJ iqeDhr0krhjuxdSQ1eGkw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrudelgdduheeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeeuvghr nhguucfutghhuhgsvghrthcuoegsvghrnhgurdhstghhuhgsvghrthesfhgrshhtmhgrih hlrdhfmheqnecuggftrfgrthhtvghrnhepuedukeehleekjeehvddvieeftdeuleeiiedu tdelhfevueeludfgleejveeitdfgnecuffhomhgrihhnpehgihhthhhusgdrtghomhenuc evlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegsvghrnhgu rdhstghhuhgsvghrthesfhgrshhtmhgrihhlrdhfmh X-ME-Proxy: Feedback-ID: id8a24192:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 3 Nov 2022 18:28:31 -0400 (EDT) Message-ID: <712cd802-f3bb-9840-e334-385cd42325f2@fastmail.fm> Date: Thu, 3 Nov 2022 23:28:29 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Subject: Re: [RFC PATCH 4/4] ublk_drv: support splice based read/write zero copy To: Ming Lei , Jens Axboe , io-uring@vger.kernel.org Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Miklos Szeredi , Stefan Hajnoczi , ZiyangZhang References: <20221103085004.1029763-1-ming.lei@redhat.com> <20221103085004.1029763-5-ming.lei@redhat.com> Content-Language: en-US From: Bernd Schubert In-Reply-To: <20221103085004.1029763-5-ming.lei@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/3/22 09:50, Ming Lei wrote: > Pass ublk block IO request pages to kernel backend IO handling code via > pipe, and request page copy can be avoided. So far, the existed > pipe/splice mechanism works for handling write request only. > > The initial idea of using splice for zero copy is from Miklos and Stefan. > > Read request's zero copy requires pipe's change to allow one read end to > produce buffers for another read end to consume. The added SPLICE_F_READ_TO_READ > flag is for supporting this feature. > > READ is handled by sending IORING_OP_SPLICE with SPLICE_F_DIRECT | > SPLICE_F_READ_TO_READ. WRITE is handled by sending IORING_OP_SPLICE with > SPLICE_F_DIRECT. Kernel internal pipe is used for simplifying userspace, > meantime potential info leak could be avoided. Sorry to ask, do you have an ublk branch that gives an example how to use this? I still have several things to fix in my branches, but I got basic fuse uring with copies working. Adding back splice would be next after posting rfc patches. My initial assumption was that I needed to duplicate everything splice does into the fuse .uring_cmd handler - obviously there is a better way with your patches. This week I have a few days off, by end of next week or the week after I might have patches in an rfc state (one thing I'm going to ask about is how do I know what is the next CQE in the kernel handler - ublk does this with tags through mq, but I don't understand yet where the tag is increased and what the relation between tag and right CQE order is). This got modeled a bit after ublk, but then diverged a bit. https://github.com/aakefbs/linux/tree/fuse-uring https://github.com/aakefbs/libfuse/tree/uring (Again, the branches are not ready by any means for review yet). Thanks, Bernd