Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp5282539iob; Mon, 9 May 2022 12:43:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyN82nlRMFk61jUqeMHPxgnwJXvNZopsRnSj7K+7oSI5+OeO4gMhV+PXygTtALT3kvHeQ/k X-Received: by 2002:a9d:6503:0:b0:5e6:d8b6:f684 with SMTP id i3-20020a9d6503000000b005e6d8b6f684mr6550930otl.289.1652125408694; Mon, 09 May 2022 12:43:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652125408; cv=none; d=google.com; s=arc-20160816; b=SHG36bFVXXz1s2vsPJsGFGmOUcnuGHFxZFJDY9HrmP0NcKbUj2WJwyLk0Ud/ajYyyR xgxt2y9jQ6ic8HAf8kWCXYvmmTr5guKa9WNUbnZLaVkdYmUObAcUDoswoBxO1OvLJ9mE 7V18XM8Duhws2SKZ9NA8m0yN/25jTxip04JIBbE+Vns2vbeWfF4XgRzjDvdTseBNnw6X oC8uovwmM2AMFTLNDQNFDtM4T+rQxUUkaff68claHejdGAWbYe38bo51i1Ct0cZWbnnM FeVAlseg4GxLvC+hf1KuFXUm1cyy3IBgwI9D8czhIb/8Sfs22hW2CjqV9qnCo8sVQ0xY 8MQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :in-reply-to:references:cc:to:subject:from:user-agent:mime-version :date:message-id:dkim-signature:dkim-signature; bh=moCKIlR1VoGBDZv7bxLTB0rBLKiRz1QcPC33EzoNnt0=; b=m+PKbemVYywXShHJyiQMFFQ3DL95WtZ6dKfsDTKbJfkOXnfDCzV0AmU4CxIAZ8HJKS XExL7LT24yYwWcWkx9IHJw/1N2ifBpD/yiSCNkXGB1ESzJepN8eWYBLMdA1xhBluiBXZ hcO+fnu1w0XIS3XFFwvrW6GJZ25BwsKWkLQLjpIHI4Wxwqr5w0ZuRfuxTPRz9EpjC09j Vt3A/vZ/5LMb24RIdFUdLUEm7QMy4xpCPTA6NtyIIl7DtIotfulrtMtlLfcX/bbfYdoh tKp50evf8IpctZdSjhSuMymudYqNvFCmOJdZwu+H9TdhN74FC5Tf1oKK7RkjK12jDbkd SxZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@urbackup.org header.s=ob2ngmaigrjtzxgmrxn2h6b3gszyqty3 header.b="C4lPPFd/"; dkim=pass header.i=@amazonses.com header.s=ihchhvubuqgjsxyuhssfvqohv7z3u4hn header.b=lzPMZQwK; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=urbackup.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id lg8-20020a0568700b8800b000e95e837300si10209454oab.213.2022.05.09.12.43.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 12:43:28 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@urbackup.org header.s=ob2ngmaigrjtzxgmrxn2h6b3gszyqty3 header.b="C4lPPFd/"; dkim=pass header.i=@amazonses.com header.s=ihchhvubuqgjsxyuhssfvqohv7z3u4hn header.b=lzPMZQwK; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=urbackup.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1E441174904; Mon, 9 May 2022 12:40:06 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240614AbiEITnz (ORCPT + 99 others); Mon, 9 May 2022 15:43:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231781AbiEITnw (ORCPT ); Mon, 9 May 2022 15:43:52 -0400 X-Greylist: delayed 2246 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Mon, 09 May 2022 12:39:56 PDT Received: from a4-5.smtp-out.eu-west-1.amazonses.com (a4-5.smtp-out.eu-west-1.amazonses.com [54.240.4.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DA9816D5CE for ; Mon, 9 May 2022 12:39:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ob2ngmaigrjtzxgmrxn2h6b3gszyqty3; d=urbackup.org; t=1652120094; h=Message-ID:Date:MIME-Version:From:Subject:To:Cc:References:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=moCKIlR1VoGBDZv7bxLTB0rBLKiRz1QcPC33EzoNnt0=; b=C4lPPFd/BL1NLovwh7MWYmrvYs820UC3KP7QN8CoQZTJ0GLWjcnwO2NN8zxHEE58 h7eL/Ie+WMnJRxCiGE+kr6LE2RFcFOaZd+FrNuV/YgRDvQ/24XsOLFRhz7pM9KLNqr9 BJKdJ44XvY6fhWNkjCYti4tvQZp0UKjPHsozKq6Y= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ihchhvubuqgjsxyuhssfvqohv7z3u4hn; d=amazonses.com; t=1652120094; h=Message-ID:Date:MIME-Version:From:Subject:To:Cc:References:In-Reply-To:Content-Type:Content-Transfer-Encoding:Feedback-ID; bh=moCKIlR1VoGBDZv7bxLTB0rBLKiRz1QcPC33EzoNnt0=; b=lzPMZQwKC5VH4ANqtvKfzIX194vwwB+Oxsf4b+F2oMy/se9Bm89BPKWK17ZFrroA pVWEXnsGs0foBMQ6lfAlmY/LNDP8rHU6HUS/g6GPtPG0Kd+qBMeXlXWfk116ct69ces abUhf0RTuXETFcMXYvXMsHVyKPv/u6+sWTxdHSdU= Message-ID: <01020180aa080721-08a3231e-71b7-4fb2-a411-cac2cbf85ae3-000000@eu-west-1.amazonses.com> Date: Mon, 9 May 2022 18:14:54 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 From: Martin Raiber Subject: Re: [RFC PATCH] ubd: add io_uring based userspace block driver To: Ming Lei , Jens Axboe Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, io-uring@vger.kernel.org, Gabriel Krisman Bertazi , ZiyangZhang , Xiaoguang Wang References: <20220509092312.254354-1-ming.lei@redhat.com> In-Reply-To: <20220509092312.254354-1-ming.lei@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Feedback-ID: 1.eu-west-1.zKMZH6MF2g3oUhhjaE2f3oQ8IBjABPbvixQzV8APwT0=:AmazonSES X-SES-Outgoing: 2022.05.09-54.240.4.5 X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FORGED_MUA_MOZILLA, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 09.05.2022 11:23 Ming Lei wrote: > This is the driver part of userspace block driver(ubd driver), the other > part is userspace daemon part(ubdsrv)[1]. > > The two parts communicate by io_uring's IORING_OP_URING_CMD with one > shared cmd buffer for storing io command, and the buffer is read only for > ubdsrv, each io command is indexed by io request tag directly, and > is written by ubd driver. > > For example, when one READ io request is submitted to ubd block driver, ubd > driver stores the io command into cmd buffer first, then completes one > IORING_OP_URING_CMD for notifying ubdsrv, and the URING_CMD is issued to > ubd driver beforehand by ubdsrv for getting notification of any new io request, > and each URING_CMD is associated with one io request by tag. > > After ubdsrv gets the io command, it translates and handles the ubd io > request, such as, for the ubd-loop target, ubdsrv translates the request > into same request on another file or disk, like the kernel loop block > driver. In ubdsrv's implementation, the io is still handled by io_uring, > and share same ring with IORING_OP_URING_CMD command. When the target io > request is done, the same IORING_OP_URING_CMD is issued to ubd driver for > both committing io request result and getting future notification of new > io request. > > Another thing done by ubd driver is to copy data between kernel io > request and ubdsrv's io buffer: > > 1) before ubsrv handles WRITE request, copy the request's data into > ubdsrv's userspace io buffer, so that ubdsrv can handle the write > request > > 2) after ubsrv handles READ request, copy ubdsrv's userspace io buffer > into this READ request, then ubd driver can complete the READ request > > Zero copy may be switched if mm is ready to support it. > > ubd driver doesn't handle any logic of the specific user space driver, > so it should be small/simple enough. > > [1] ubdsrv > https://github.com/ming1/ubdsrv/commits/devel Great! It would be interesting to do some tests on how much faster (IOPS) this is than doing this via fuse: https://github.com/uroni/fuseuring