Received: by 2002:a05:7412:bb8d:b0:d7:7d3a:4fe2 with SMTP id js13csp100451rdb; Mon, 14 Aug 2023 10:38:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHGhQ/l1+fQi2Mvlqdkwz1wH4IE6dbOtIu+rFo+ebHb1I9NWaWtImBhaWVOm0tHBmRXrT/l X-Received: by 2002:a17:902:ced0:b0:1b9:da8b:4eac with SMTP id d16-20020a170902ced000b001b9da8b4eacmr10852206plg.56.1692034711578; Mon, 14 Aug 2023 10:38:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692034711; cv=none; d=google.com; s=arc-20160816; b=CN4I17LOcyBK0jgifu0oS7I0D0J118eFhcgsGQB3iLLR2J+IS2kF3iLdt7lC2eZIig 5nXt67zOSL/I9Z51aszSw3hAD3qquvp0delpIrc7Rm6gTeL5nCu3TCI5Fi7Lr5WN9UWV NavHB7nxiYkzRTv8BdTWidVy959WOpzQlCm3z6PjXfLZ1GKbpnGxM4beGbkNvckL3lPY byVzxg4IgZQyUmfAASmYY4ADQQO9kObRjQH4hfpCEZZ4j5e92s7HMRPTqYaP+LXaTJdZ yC8RzSfmqcVX5x198mJwt0D8uwsQLt5FRmcCBc+nN1Ns5MEddqjxmKRo+VdJgIJjasGA cKVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=KoOgtExPknyCjaZt6yFcpJm1OTXC8gB2XRIzfWFG1zw=; fh=829K/eMgRXmqXoiePchKgKoaM9MEC2V1MOioG4VQ4nc=; b=L+U0QKNPghR6dJXpJnMSSjtlku23qKw7Xqv6L7MsBQrLGYkzM1h0hnE/H8f3WJNuQw 5rze5oLQflRFdjNrn0cm8ouY10fkpVXD9QDu0vhJAxes6LPbEBi8sMJ/sRuVMY868ql2 V0YcjQR5ckQ24YaY6NPMl9q/M78gxKAXkdTkUek/uKddYSTniqZQ4DEJDFWkGFMcFD3x plq3Oq1a4WNkEWpC0Ks+yB+HxHTUDjj0BBEOU/YbROx1SLpgy1uVKuXRGqQGkiPbKZXm HeoQsOL83GtZDFTBM3DKmRUWjyqgui4wNa3JXgdU8ELvxvXRPC4f0BX1/CnvRnqYDFPt bmSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=XLYg47Tz; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s20-20020a170903215400b001b025aba9f2si8035038ple.22.2023.08.14.10.38.17; Mon, 14 Aug 2023 10:38: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=@gmail.com header.s=20221208 header.b=XLYg47Tz; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229717AbjHNRCf (ORCPT + 99 others); Mon, 14 Aug 2023 13:02:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229721AbjHNRCF (ORCPT ); Mon, 14 Aug 2023 13:02:05 -0400 Received: from mail-yb1-xb29.google.com (mail-yb1-xb29.google.com [IPv6:2607:f8b0:4864:20::b29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 170E5E65; Mon, 14 Aug 2023 10:02:05 -0700 (PDT) Received: by mail-yb1-xb29.google.com with SMTP id 3f1490d57ef6-d43930354bcso3209245276.3; Mon, 14 Aug 2023 10:02:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692032524; x=1692637324; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=KoOgtExPknyCjaZt6yFcpJm1OTXC8gB2XRIzfWFG1zw=; b=XLYg47TzlIjv0bDM3AhmFaX0S1yOUGR0Ki1gyiGdT/2yEwVkM8/9mdaMTU37WM1DT6 ExF1EsTqfg0PvHcTo77VcOpQ4jYwSM3nKmtdF0/FJ8Oxxy92UaKByZygEwud8PnWgjJZ E99louhXal4GvwauXD4HIZ+pIanBpSWe3BhzNKazqDdGMDiS5paRiXveT0ouptcFvmPa V+57PNGVpPVN42nGM58YFn43daZnIPF9eM2j1KwSKq0YOesYSdKHe9RXf7Fk0KuDXTy9 c76wWof7WARoY8G2dxdDjgExCVaqoDIWuUNTx2SoQZO+kdGqvNBmzIuEeLU8kSgR5G8+ mMOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692032524; x=1692637324; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KoOgtExPknyCjaZt6yFcpJm1OTXC8gB2XRIzfWFG1zw=; b=ciVs1FX8PGvfmgrlQ/yHb9jfn2oOBAYpEyxjY9Jw5UL+g8f4np599DDt7ZaBz487qZ CAHCJGlRBgOGNNiaxD9urK4REgCdmM+2iED3598lX45PZjpykdxwJTQlCMubQfNO1jlP NPA/G4qDvhl/iMlla7yNHN04vorCqIt4RwIOHKpmmgMg+zqbt9uJx0agjCG6Z7tRJBrC ND28Hn0k2rRSrbGBxms08zUK252pZ3SBSQgSRlXvse9o7yAnYOiOTmgW7mzR6QR12oaB kwQRTaG5hPO39GLHB30VYicHUKbROrOOKONArhuO+VjhklhIedkWT3od8FlBcHcN9H/j M6CA== X-Gm-Message-State: AOJu0YyGecuOaHB8i9UMkKDErEEAU1odBxgvd7jQsmP1uc8NTKFp6foe 7AVC8NdzdxtoYhMj9i1yi98nSyavtXaNjIiLTHA= X-Received: by 2002:a25:2386:0:b0:d15:f337:938b with SMTP id j128-20020a252386000000b00d15f337938bmr8112041ybj.8.1692032524122; Mon, 14 Aug 2023 10:02:04 -0700 (PDT) MIME-Version: 1.0 References: <20230811105300.15889-1-nj.shetty@samsung.com> <20230811105300.15889-4-nj.shetty@samsung.com> <0899ddc3-d9c1-3d9a-3649-2b1add9b2a7f@acm.org> In-Reply-To: <0899ddc3-d9c1-3d9a-3649-2b1add9b2a7f@acm.org> From: Nitesh Shetty Date: Mon, 14 Aug 2023 22:31:53 +0530 Message-ID: Subject: Re: [dm-devel] [PATCH v14 03/11] block: add copy offload support To: Bart Van Assche Cc: Nitesh Shetty , Jens Axboe , Jonathan Corbet , Alasdair Kergon , Mike Snitzer , dm-devel@redhat.com, Keith Busch , Christoph Hellwig , Sagi Grimberg , Chaitanya Kulkarni , Alexander Viro , Christian Brauner , martin.petersen@oracle.com, linux-doc@vger.kernel.org, gost.dev@samsung.com, Anuj Gupta , linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-block@vger.kernel.org, mcgrof@kernel.org, dlemoal@kernel.org, linux-fsdevel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,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 Sat, Aug 12, 2023 at 3:10=E2=80=AFAM Bart Van Assche wrote: > > On 8/11/23 03:52, Nitesh Shetty wrote: > > + * Description: > > + * Copy source offset to destination offset within block device, usi= ng > > + * device's native copy offload feature. > > Offloading the copy operation is not guaranteed so I think that needs to > be reflected in the above comment. > Acked. > > + * We perform copy operation by sending 2 bio's. > > + * 1. We take a plug and send a REQ_OP_COPY_SRC bio along with sourc= e > > + * sector and length. Once this bio reaches request layer, we form a > > + * request and wait for dst bio to arrive. > > What will happen if the queue depth of the request queue at the bottom > is one? > For any reason if a request reaches the driver with only one of the src/dst= bio, copy will fail. This design requires only one request to do a copy, so it should work fine. > > + blk_start_plug(&plug); > > + dst_bio =3D blk_next_bio(src_bio, bdev, 0, REQ_OP_COPY_DS= T, gfp); > > blk_next_bio() can return NULL so its return value should be checked. > Acked. Thank you, Nitesh Shetty