Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3396264rwd; Mon, 29 May 2023 09:47:55 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4x1JWXSaPj715I2bb0rrva3XLSXA7mmsUt9t0R4qFUxZuN22BvadFFabZ+Yqa1XXvRdc6A X-Received: by 2002:a17:90a:72cf:b0:252:ad83:5907 with SMTP id l15-20020a17090a72cf00b00252ad835907mr11067710pjk.16.1685378875348; Mon, 29 May 2023 09:47:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685378875; cv=none; d=google.com; s=arc-20160816; b=nOCFh9idW5KwTyCfwEpVmlC21NzIwNrwCrBmodpeVjiID87mkJm121/K8alG0S8t7k GriWHlZMGWj+pBwZk9/UVbbtiW/5WC4/IsJF7wzZOUNoqGeJk4m2eQe6awn6D5YnZmTe CL7x9YVJr4WFGOCbkYBPSVoYDla2tYpP7QkYK6mQYo9thLRg9m108pw6/cYCbLV6bYAR 41MpFqYqnsSslKG5haSDrHiENHzbJawylvmSAstl1b0cGHkgvNg5gk+T7G1fYfJZSs2+ 2L8Z5+96QkvwDoyGNDWD4cFSVt9I2X1xs8DSMBHYAnnts2gG1DiyYHKeZr3y2F8zybuP uIPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=XGlmlfpGRhYW8HjfyI5EG9tKXwTbZGzHl2Gw/X6ax14=; b=QBB4pbc238FNjvjnUTmYyLUikTTFMTWlGkZg4L6ntr1rg4QCkNXoXRdWENP2riZQyQ xL6/+uPH6NVtTIpAG5PotMzBHFiIN1QkogXhFYjOlYcr/tkNyIZUI84nt4rIuULYW/ze U5fGSVj77LYTZgNbctipM4DN1ITE+8uNqtMlDlnQhryavcYO+e48Ka00xB5L6ejaAdYn 61Jfe92Lyj2vmCkdRmU2oqFb/CGS/BVBPgN4djpeZYQ1uNTI79erf6JWssU/gnsRBlFG dvs7bgneNfl8smHVONyV49jgbqXlV1JNbp6M/i6mhctYrtLHRb989yzwladKhc9InDiy N/Ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=gD4kPaLL; 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 k3-20020a637b43000000b00530b7f4243dsi9658946pgn.191.2023.05.29.09.47.42; Mon, 29 May 2023 09:47:55 -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=gD4kPaLL; 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 S229584AbjE2Qh1 (ORCPT + 99 others); Mon, 29 May 2023 12:37:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229468AbjE2QhZ (ORCPT ); Mon, 29 May 2023 12:37:25 -0400 Received: from mail-yw1-x1136.google.com (mail-yw1-x1136.google.com [IPv6:2607:f8b0:4864:20::1136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0ACCC1BD; Mon, 29 May 2023 09:36:49 -0700 (PDT) Received: by mail-yw1-x1136.google.com with SMTP id 00721157ae682-565eb83efe4so24202567b3.0; Mon, 29 May 2023 09:36:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685378184; x=1687970184; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=XGlmlfpGRhYW8HjfyI5EG9tKXwTbZGzHl2Gw/X6ax14=; b=gD4kPaLLf9pJV0lpw2cIWttEo9EVBn7x8f+92LW12OXCCFANe21Fg01PjDXO0UtxY2 Ub5I5H1SdDWAoWmUFNeFLAYHmxDq8YTSmOaqguooZLFZobRrzvTxGbtaD72knDH23eOR MY6ARUPzlKzmyW1m+BBJysdYOhoJdDqFYBuSUXe+0EMClHkTcg4RjJwjoiWhoOTKM3Dt 9K997gDZQsyxazGzIDcLguDZimyccw5IT7vyORCRBHtiqJDhUH/qSIl0d7GezyQg513/ VW7HwcNry8jcfbS5LOs9BUzeIfyV4CP5ISfkACbfC7ABZjMV3VQHFd1Zf4JXCiU+XtDx EW2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685378184; x=1687970184; h=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=XGlmlfpGRhYW8HjfyI5EG9tKXwTbZGzHl2Gw/X6ax14=; b=GsNNlAKbeXflSyaAa6v79IOGVeQxbnXU1jT7PQgFL7HfCIJLIn0ORbsSofuQ+8WE4X TUHtFu1vAFklN4LpJvxI2XwOF7lKxOrICDBk9tSqql2w69jZu+NN7c8X1w5f0RyvZdJd pdcWa3h4ppCrAtpuEilCU1rbR665Yj3UKjvcfOZzqjuabu62r32VXzBqP5ZJbSIQbEMH SFI4ZR2/NATus1f38WMMzSNzSfa31jmqF6MyxYHQN6FOXDaRX5xwQ3Xda+x/ns2ic8g+ lmKB2qR7LT5ZBI0rBzqOAb0ghe7n14LwyuQy4Bn/ZGQykhlAwaKRMXmXd/ypSxqkDKtI hbbA== X-Gm-Message-State: AC+VfDxdASf+QV70XbJiWXTY1CpTM1L1BdwawKGia5e+249t5YtYodcX b7D03l4EtXIVz6TuMUlQt5pPrCAMZd/eD6Bf9D8= X-Received: by 2002:a0d:d88b:0:b0:565:bb04:53fa with SMTP id a133-20020a0dd88b000000b00565bb0453famr11663162ywe.10.1685378184319; Mon, 29 May 2023 09:36:24 -0700 (PDT) MIME-Version: 1.0 References: <20230522104146.2856-1-nj.shetty@samsung.com> <20230522104146.2856-3-nj.shetty@samsung.com> <20230524154049.GD11607@frogsfrogsfrogs> In-Reply-To: <20230524154049.GD11607@frogsfrogsfrogs> From: Nitesh Shetty Date: Mon, 29 May 2023 22:06:13 +0530 Message-ID: Subject: Re: [dm-devel] [PATCH v11 2/9] block: Add copy offload support infrastructure To: "Darrick J. Wong" Cc: Nitesh Shetty , Jens Axboe , Alasdair Kergon , Mike Snitzer , dm-devel@redhat.com, Keith Busch , Christoph Hellwig , Sagi Grimberg , James Smart , Chaitanya Kulkarni , Alexander Viro , Christian Brauner , "Matthew Wilcox (Oracle)" , Andrew Morton , linux-block@vger.kernel.org, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, linux-mm@kvack.org, gost.dev@samsung.com, anuj20.g@samsung.com, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, ming.lei@redhat.com, James.Bottomley@hansenpartnership.com, linux-fsdevel@vger.kernel.org, dlemoal@kernel.org, joshi.k@samsung.com, bvanassche@acm.org Content-Type: text/plain; charset="UTF-8" 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_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 > > +/* > > + * @bdev_in: source block device > > + * @pos_in: source offset > > + * @bdev_out: destination block device > > + * @pos_out: destination offset > > + * @len: length in bytes to be copied > > + * @endio: endio function to be called on completion of copy operation, > > + * for synchronous operation this should be NULL > > + * @private: endio function will be called with this private data, should be > > + * NULL, if operation is synchronous in nature > > + * @gfp_mask: memory allocation flags (for bio_alloc) > > + * > > + * Returns the length of bytes copied or error if encountered > > + * > > + * Description: > > + * Copy source offset from source block device to destination block > > + * device. Max total length of copy is limited to MAX_COPY_TOTAL_LENGTH > > + */ > > +int blkdev_issue_copy(struct block_device *bdev_in, loff_t pos_in, > > I'd have thought you'd return ssize_t here. If the two block devices > are loopmounted xfs files, we can certainly reflink "copy" more than 2GB > at a time. > > --D > Sure we will add this to make API future proof, but at present we do have a limit for copy. COPY_MAX_BYTES(=128MB) at present. This limit is based on our internal testing, we have plans to increase/remove with this limit in future phases. Thank you, Nitesh Shetty