Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp1252975rdg; Fri, 11 Aug 2023 15:20:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHzoQLa7mCzOneLrr9hPJvWN3ZSY1y+UNTkb0XBd3xN3wVRwWMQwLZJKytpl2zpiAAC/ts0 X-Received: by 2002:a05:6830:18e:b0:6b9:924e:b43b with SMTP id q14-20020a056830018e00b006b9924eb43bmr3203495ota.6.1691792424665; Fri, 11 Aug 2023 15:20:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691792424; cv=none; d=google.com; s=arc-20160816; b=0eIVTbJTatS1AB5TxyGTHGEkVsVExZILjUKueyjHBg0IOVzapGzlIkxR4ojqYZLGXW UZ62GrX+1ZNOYhdlBVM/MqI5l+wnB7PcSH75PDLL/FfY0U2vVdBkloftNMM9nZgxkekF 2GiRELPMyjR+FDGfueqeh17BmVNQxWPFOIWErvsEfmfSUF/to+CZ2oxb+bbxyejgiqBO C3pwlvfaG0cEhGrXRLNG55zPrbc3KmPByBG2Dbz6qYU6YDWuIvSzgNj+naHT+htciXgO px4mtC5YHZ5XLhMBgPJXVD6U9ALcidfd8JQKJ7BeRy5Y9QwFNTPaaVmmcFexlISPJPqm fZLw== 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 :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=hL47jFFvDt7OXD+hxa5Uxt7WguECwOQyvoULO24VUWQ=; fh=cAbOUiFLjTeW77TQOgawX0tk2ZYaCn9Nl4YOSZpwi/c=; b=qhe4v426eUpjPXposZtiGCxJd0a3BGvyYtX5RpDwnb5eYJohYYw0+dy43Sj6qjmc7B brLn0SiNRWGHyBpEEpHbfzyKomCbqjXhf04RAnXAjJrIehmtgbtH3gb2FD4t7njd75k9 k0dUpJ9VFAu4ZVQeVG+3Z9+cIdmc3WQsmUO6liFMGdo/FsYmmKQogDugcoSCgb44APxG 5mUmb3lQtm8b+8l6xIwd28zeZsTxGz5dwjfJ6+BIonb/ga7ZPMsTTtMVbxgrnuZorqxb Isaek0BO1Qi1Kh0qVLv04ro1UII8OSko1THEpuK5IMzQ//4cBUvyq/wqty2hB4R4+3xy 8sCw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=acm.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gm16-20020a17090b101000b002682dc64492si3976807pjb.185.2023.08.11.15.20.06; Fri, 11 Aug 2023 15:20:24 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=acm.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236294AbjHKVdl (ORCPT + 99 others); Fri, 11 Aug 2023 17:33:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231894AbjHKVdj (ORCPT ); Fri, 11 Aug 2023 17:33:39 -0400 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1ABCC213B; Fri, 11 Aug 2023 14:33:39 -0700 (PDT) Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-1bc6bfc4b58so18370815ad.1; Fri, 11 Aug 2023 14:33:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691789618; x=1692394418; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=hL47jFFvDt7OXD+hxa5Uxt7WguECwOQyvoULO24VUWQ=; b=Dh0MOfU1NkRojl0RuAjwAque2K16nkp4fsGy9S8iv9duyyy13UyYb586V03V1qiFra Fi4x4GGS95SngtDhXh6UUIVprop/rkcofl+MesL8ocnhqyP3kg8FfNrWtPy7pI6InWQ0 ZL+f7UJ1FlWaCZPj2lb5Zk0ihCeHwpXUMsVL04fS1V2EzUIfBp+MsyUQHBCZEvSI36ci ThOEHjueCIx7fpqxqW8ZUIutn1O2NhHserpEIhf6cW596mdpyy5ygfeU6lpKy/bLr2WO XqvDB0w0t59MApxFAmKBuupRtPlUa7ppQblWEr3LElQwGDKeXBOVTqj7s0XP8siGYoqx jtsA== X-Gm-Message-State: AOJu0YycKTyvF08+GxrxLzXTckuswGNTawIMte4/2SWyci1zs57LR+SV H3iWmW3hRzQF8y2Ps/GN/yk= X-Received: by 2002:a17:902:e809:b0:1bb:de7f:a4d4 with SMTP id u9-20020a170902e80900b001bbde7fa4d4mr3429993plg.61.1691789618406; Fri, 11 Aug 2023 14:33:38 -0700 (PDT) Received: from ?IPV6:2620:15c:211:201:cdd8:4c3:2f3c:adea? ([2620:15c:211:201:cdd8:4c3:2f3c:adea]) by smtp.gmail.com with ESMTPSA id a4-20020a1709027d8400b001bc87e6e26bsm4378373plm.222.2023.08.11.14.33.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 11 Aug 2023 14:33:37 -0700 (PDT) Message-ID: <0899ddc3-d9c1-3d9a-3649-2b1add9b2a7f@acm.org> Date: Fri, 11 Aug 2023 14:33:35 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [dm-devel] [PATCH v14 03/11] block: add copy offload support Content-Language: en-US To: 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 Cc: 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 References: <20230811105300.15889-1-nj.shetty@samsung.com> <20230811105300.15889-4-nj.shetty@samsung.com> From: Bart Van Assche In-Reply-To: <20230811105300.15889-4-nj.shetty@samsung.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, NICE_REPLY_A,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, 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 8/11/23 03:52, Nitesh Shetty wrote: > + * Description: > + * Copy source offset to destination offset within block device, using > + * 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. > + * We perform copy operation by sending 2 bio's. > + * 1. We take a plug and send a REQ_OP_COPY_SRC bio along with source > + * 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? > + blk_start_plug(&plug); > + dst_bio = blk_next_bio(src_bio, bdev, 0, REQ_OP_COPY_DST, gfp); blk_next_bio() can return NULL so its return value should be checked. > + dst_bio->bi_iter.bi_size = chunk; > + dst_bio->bi_iter.bi_sector = pos_out >> SECTOR_SHIFT; > + dst_bio->bi_end_io = blkdev_copy_offload_dst_endio; > + dst_bio->bi_private = offload_io; Thanks, Bart.