Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp251179rdh; Sat, 23 Sep 2023 08:51:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHYFuukiLvJL1WU54dh6MbMycRbHXTRkh09R0gJf5QTMjtSjv6q8gscXWNUGWxZCzukeoB5 X-Received: by 2002:a17:902:cec4:b0:1bc:5e36:9ab4 with SMTP id d4-20020a170902cec400b001bc5e369ab4mr4179276plg.21.1695484267842; Sat, 23 Sep 2023 08:51:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695484267; cv=none; d=google.com; s=arc-20160816; b=M0tcFQf0ZqMbTeDj8dbJfQzc+xCw2aNBR35BlC/zCCw3GPM0KLvOa46xuRv4ubgPi2 Alcvm4lfcnodsiv73Qi0fhjSX+G82DJdVKW4X/j18WNgQJXO+ubL4uRkzA6ZULJlxVnW p4IobsAFwRe4X6dJY6hR5yJ6MItzv3iW3lSOBOfbg6tNtqMHDu57Ls0vVLNZdR9OHH9K HK/Wf4tLvmo8z8jPvwb/rzp0znq7q9+tO9cfm3zTRhnJF+uUslUos/FO3izHlAxiYMlj YxK0JQrwfAJFqNXWG9JzOWrthR6D6ep2R7Cc9G3j9yibGz/m6QpbjQgRteCzC6iU4Zsw 0tow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:dlp-filter:cms-type:user-agent :in-reply-to:mime-version:message-id:subject:cc:to:from:date :dkim-signature:dkim-filter; bh=TLE/Sy/4Fa+njmqsxxYakkAuq43NHPAgx52dBzDfrZA=; fh=uTMWByuHTv71v4cl4/L9slVvzyG4GoZlCBj70qLDzDw=; b=YPplmltm/rDSzIbuEv1AipnhngEzDjFWMDixGJ9Dhzggz0OUwbjyJM78eiG5IpVmsq yLHqvjWwqAmdk+/3sdRtLddCKfb1PDprJ5crNcKy13HvQqPfe7+hgSUsNSugF90H2DzB Vux7K5yUNde7I88vZgHKmKrhR4gt8YqKU+NNTF1zjsj1SEKOkoQZxk/4qID9yJezwEOZ qwYFbrCCWq2qvx53kP3gt0IlIg4BCJ2iJDsDXmHXta2ptMp2sPT6ktTKMOSMteRFrZEL 6qS0rHz+vBCMOz71/CnxCrzB5JAyE4LcVJOTX0yaiZun9WWgA3t6jp0Vt2UuVKCNsiMC j6bA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b="h/BWI4Df"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id q7-20020a170902dac700b001c44c0f8d96si97834plx.251.2023.09.23.08.51.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Sep 2023 08:51:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b="h/BWI4Df"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 01F32823F5FC; Sat, 23 Sep 2023 01:13:30 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230428AbjIWINU (ORCPT + 99 others); Sat, 23 Sep 2023 04:13:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230334AbjIWINR (ORCPT ); Sat, 23 Sep 2023 04:13:17 -0400 Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 629141B0 for ; Sat, 23 Sep 2023 01:13:09 -0700 (PDT) Received: from epcas5p2.samsung.com (unknown [182.195.41.40]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20230923081305epoutp02638e805e2580eebb80da98bf210dac50~HePaWAgP72609926099epoutp02a for ; Sat, 23 Sep 2023 08:13:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20230923081305epoutp02638e805e2580eebb80da98bf210dac50~HePaWAgP72609926099epoutp02a DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1695456785; bh=TLE/Sy/4Fa+njmqsxxYakkAuq43NHPAgx52dBzDfrZA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=h/BWI4DfmcnNaHBy6QEQOVpke8+msZ4Ysg5JXgqBpX/KOBzL2t0KTNKyTU7BW30VN 9FjXB5laHJDm7pt9AU3Mcf9q7skaptZLcmsQeiCICp4QRz4db4PP2Mte6G3yKiqKgk w2Y4rvlrH8jV2WumXnyYSD87oeAmQXNLS6y4Lqhc= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas5p1.samsung.com (KnoxPortal) with ESMTP id 20230923081303epcas5p1556a5e37929a332e7b59407ddb854315~HePY2SkX20487904879epcas5p1i; Sat, 23 Sep 2023 08:13:03 +0000 (GMT) Received: from epsmges5p2new.samsung.com (unknown [182.195.38.183]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4Rt22449bnz4x9Pr; Sat, 23 Sep 2023 08:13:00 +0000 (GMT) Received: from epcas5p4.samsung.com ( [182.195.41.42]) by epsmges5p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 20.26.09638.C0E9E056; Sat, 23 Sep 2023 17:13:00 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas5p2.samsung.com (KnoxPortal) with ESMTPA id 20230922111746epcas5p204bf631f0d45f43c5fb13bad26b2c798~HNHYET5c51000710007epcas5p2q; Fri, 22 Sep 2023 11:17:46 +0000 (GMT) Received: from epsmgmc1p1new.samsung.com (unknown [182.195.42.40]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20230922111746epsmtrp22f04a152ad73f84d56629c97edbd2234~HNHYDC8w22146921469epsmtrp2S; Fri, 22 Sep 2023 11:17:46 +0000 (GMT) X-AuditID: b6c32a4a-92df9700000025a6-78-650e9e0ca620 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgmc1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 16.D3.08649.AD77D056; Fri, 22 Sep 2023 20:17:46 +0900 (KST) Received: from green245 (unknown [107.99.41.245]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20230922111742epsmtip1dfbf7bb7f35d2f16f25d65543eb97821~HNHU3SCWc2955729557epsmtip1A; Fri, 22 Sep 2023 11:17:42 +0000 (GMT) Date: Fri, 22 Sep 2023 16:41:41 +0530 From: Nitesh Shetty To: Jinyoung Choi Cc: 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-scsi@vger.kernel.org" , "nitheshshetty@gmail.com" , "anuj1072538@gmail.com" , SSDR Gost Dev , "mcgrof@kernel.org" , Hannes Reinecke , Anuj Gupta , "linux-block@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-doc@vger.kernel.org" , "linux-nvme@lists.infradead.org" , "linux-fsdevel@vger.kernel.org" Subject: Re: [PATCH v16 03/12] block: add copy offload support Message-ID: <20230922111141.GA14640@green245> MIME-Version: 1.0 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OfWO2wgQ5kFpCWW/+OACMtL NG+dDXYbp4CfRHfbUbBzRAWUJQ5sO840gVFoFpJJs5BMmoUwaRaSSQsYWVYxSqYWFOem5yYb FhjmpZbrFSfmFpfmpesl5+duYgQnDS2NHYz35v/TO8TIxMF4iFGCg1lJhDf5E1eqEG9KYmVV alF+fFFpTmrxIUZpDhYlcV7DGbNThATSE0tSs1NTC1KLYLJMHJxSDUw8pTu/rag/wGq6M8Qo Z3a54I399ipzfzQd3fQyQJpxSzjLKl/l5UnGD++fnXtqQbHA7OgZj3jXyLpn7b/tPve7rVHj +s2bnn34lbdR98SW5wK2O9RXFXB0Sc7JWTvlRdu5zitrX79kqcmLzJOcMnfxh5dChgLRwt4b tW9Kh9mqfXFYalUTfKx8gpuA/8+vMvwG865f63qyfs6XinyR70t/NbQZPPh+dXZI+deT/au2 pmU+3iFlyL5vDxszb8j3IL4FnzXnekQpXXlS05Ba+uWW65pXIZInTz7M9RB5dzlyV/tsEbGj HMYbOCzv3jywwlV70cOIa8f9lwa/ETi5OcDmjqLHtz05XCtjplXqGpeKK7EUZyQaajEXFScC AFPrTUWJAwAA X-CMS-MailID: 20230922111746epcas5p204bf631f0d45f43c5fb13bad26b2c798 X-Msg-Generator: CA Content-Type: multipart/mixed; boundary="----r74_f6S_OIQxXK41.4aq6v4zMY6akVoN.sMgyBemj3VfQZgP=_119e9_" X-Sendblock-Type: REQ_APPROVE CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20230920081447epcas5p144e631c5b8c72acf64d38b04d6c2c925 References: <20230920080756.11919-4-nj.shetty@samsung.com> <20230920080756.11919-1-nj.shetty@samsung.com> <20230922095650epcms2p8e25340eff5de01f8b3ce63ae81266881@epcms2p8> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Sat, 23 Sep 2023 01:13:30 -0700 (PDT) ------r74_f6S_OIQxXK41.4aq6v4zMY6akVoN.sMgyBemj3VfQZgP=_119e9_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Content-Disposition: inline On Fri, Sep 22, 2023 at 06:56:50PM +0900, Jinyoung Choi wrote: > > +/* > > + * This must only be called once all bios have been issued so that the refcount > > + * can only decrease. This just waits for all bios to complete. > > + * Returns the length of bytes copied or error > > + */ > > +static ssize_t blkdev_copy_wait_io_completion(struct blkdev_copy_io *cio) > > Hi, Nitesh, > > don't functions waiting for completion usually set their names to 'wait_for_completion_'? > (e.g. blkdev_copy_wait_for_completion_io) > > > > +ssize_t blkdev_copy_offload(struct block_device *bdev, loff_t pos_in, > > +? ? ? ? ? ? ? ? ? ? ? ? ? ? loff_t pos_out, size_t len, > > +? ? ? ? ? ? ? ? ? ? ? ? ? ? void (*endio)(void *, int, ssize_t), > > +? ? ? ? ? ? ? ? ? ? ? ? ? ? void *private, gfp_t gfp) > > +{ > > +? ? ? ? struct blkdev_copy_io *cio; > > +? ? ? ? struct blkdev_copy_offload_io *offload_io; > > +? ? ? ? struct bio *src_bio, *dst_bio; > > +? ? ? ? ssize_t rem, chunk, ret; > > +? ? ? ? ssize_t max_copy_bytes = bdev_max_copy_sectors(bdev) << SECTOR_SHIFT; > > wouldn't it be better to use size_t for variables that don't return? > values such as chunk and max_copy_bytes may be defined as 'unsigned'. Agree, we will keep ret as ssize_t and move others to size_t. Acked for all other comments, will address them in next version. Thank You, Nitesh Shetty ------r74_f6S_OIQxXK41.4aq6v4zMY6akVoN.sMgyBemj3VfQZgP=_119e9_ Content-Type: text/plain; charset="utf-8" ------r74_f6S_OIQxXK41.4aq6v4zMY6akVoN.sMgyBemj3VfQZgP=_119e9_--