Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp3068700lqo; Tue, 21 May 2024 06:09:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVt4yo8y2HBNtRD7khuVpxXqjN9jiYXUdffy4uWv9C25jN3OfuBjMdgKddxnPsUuO/4N19W4lDKhXwu1J6FmpCt1QM3jscQ0tbbKAgmkQ== X-Google-Smtp-Source: AGHT+IEUQJB7RWvoa+/fp1wwG5PKqM0nTr6NYQBBBe1kNWpGYvXLrCBj0f5HzKLL6MoknbwesbJt X-Received: by 2002:a05:6a20:daa2:b0:1af:9edd:9cb3 with SMTP id adf61e73a8af0-1afde0cb50fmr37092783637.17.1716296961777; Tue, 21 May 2024 06:09:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716296961; cv=pass; d=google.com; s=arc-20160816; b=pX0+35gWFaT+IUoWfKVd6H6kMIq1jFu2Rpehu+CvJu2MaFu8VnpkbOoawUuIhYPWBc ExjQFbPx8lXJRLDMuea2wSEAbWFKfSGKjfP/Z+FiaHbPgDw9R2I6D8ZqdbnJJ5MQLPWU nnDTu6dG7dR6kPa6I+wSH6SOh1A8W4AzvL1Byv/9Ukh1ag3Fhco9A80WQdu2wh9Jb0/A vzAS/DL0+y8/kdtd0aFyMKT5suWptqOa9O1RyxM8STGURbxknehqdUgMw4gfGjUmLYj2 bj2yG7bgzkycSJ87fwesj0jMJIoiN4joOo+iYmuxOUNC3zUVlEr3dZGkOKvX0YC41ZyT Bg3Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:dlp-filter:cms-type:user-agent:in-reply-to:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:message-id :subject:cc:to:from:date:dkim-signature:dkim-filter; bh=68M8UQdBQ84meqytW018nu4+AHUsAxOzbElXzqhsHvM=; fh=YLd9IbdBOj0P4PR96j+f2rfPLb7/dchyclgdvoY1PWc=; b=wQhpt6Zph3vHluz5uOTdg3W9BmwL7U3E3V7SJjCbN5trQvKzSu1L7fcjeZpqTR0YwE El+jKJ9+5UyfR6ZhLCuWI//WNzh4UPD+D5pYtZbzYNucmTnkGmwPLUf4WUn3v1Of+DaU E4PuTXGMbBJtsXr9ng3te0Ypjc4rq9Qpqtfg7xNxC/ggCx7goLjF6EU7azxUf752HuHS lSPyDcR2hRL+5g7tKr/3fUhqq0V7Mvb59PvrqEB4NyOjaqN10W5MN+UOdKOwWoqbehQw LAfbVovPA0+w1EUNjdEaERamiGjLUYnCjoZLh9qd3imIFx3aXaQPKB8Of5r2guk78Yi1 5vVA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=ETuRVkyS; arc=pass (i=1 spf=pass spfdomain=samsung.com dkim=pass dkdomain=samsung.com dmarc=pass fromdomain=samsung.com); spf=pass (google.com: domain of linux-kernel+bounces-184993-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184993-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 41be03b00d2f7-634103f5640si5046245a12.402.2024.05.21.06.09.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 06:09:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-184993-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=ETuRVkyS; arc=pass (i=1 spf=pass spfdomain=samsung.com dkim=pass dkdomain=samsung.com dmarc=pass fromdomain=samsung.com); spf=pass (google.com: domain of linux-kernel+bounces-184993-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184993-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 73B58B22CFA for ; Tue, 21 May 2024 13:08:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C41CB78C89; Tue, 21 May 2024 13:08:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="ETuRVkyS" Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7FA7971754 for ; Tue, 21 May 2024 13:08:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.254.224.24 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716296895; cv=none; b=e65LxRaAWwWrg1G1F4bwBruK9tWPSAVsWx7TScDcr8HlIiywN9is6mzgIgDi+K+G+DathJHTQzlPaPiACAGnVW4r5Xt/ZL401AMgnzjM4SK4gYYzvnpt2NM0/Ivn3A1CuCVS5ODzrucrMqKhFIER7hsFCokKNv8LRD+vmUovvu4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716296895; c=relaxed/simple; bh=9zPFf0Squvi1mogXdW3GaYX5jzlFVa4hNNRrNLBWF0M=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:In-Reply-To: Content-Type:References; b=SAGXseUl2hmhMNgomX+PG8rs7Nx1AGdODORK4HIxAQZ21pSYAF9tdlZUhgGIIEuItmcDzTmNMFB/QpILXD6alxg6rIa07AmTyIq/MMwl3/q/yzVFTXqgOk088CNafHwYagITh+WZTyW/2Zk6BLBvh3NqVWuRaxNH9ug2mIK+PXY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=ETuRVkyS; arc=none smtp.client-ip=203.254.224.24 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Received: from epcas5p2.samsung.com (unknown [182.195.41.40]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20240521130809epoutp01ca96bb430314bceec60a91d9fda54b3a~Rgu1_k61-1800318003epoutp01C for ; Tue, 21 May 2024 13:08:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20240521130809epoutp01ca96bb430314bceec60a91d9fda54b3a~Rgu1_k61-1800318003epoutp01C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1716296889; bh=68M8UQdBQ84meqytW018nu4+AHUsAxOzbElXzqhsHvM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ETuRVkySJlalDf75vQvztLjWmhXg9wimNdvuJKwVGRm6eXZHU46lN/F7Ts83lcBxQ Xhij3mw3Aa3mdM+oukSyrGDGbxwoBbI7VhmxX6MJL/NbN+CYwNenlnkvfIXzySiDtE VKYeyWxX/sXDu48YL25++zDo58X7TenbnIiuidio= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas5p3.samsung.com (KnoxPortal) with ESMTP id 20240521130808epcas5p339c7e9e25274e9e8056c6fae9f3fb3b6~Rgu1Tc04o1587915879epcas5p3m; Tue, 21 May 2024 13:08:08 +0000 (GMT) Received: from epsmgec5p1new.samsung.com (unknown [182.195.38.181]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4VkF9M0B8dz4x9Pp; Tue, 21 May 2024 13:08:07 +0000 (GMT) Received: from epcas5p1.samsung.com ( [182.195.41.39]) by epsmgec5p1new.samsung.com (Symantec Messaging Gateway) with SMTP id D0.32.08600.6BC9C466; Tue, 21 May 2024 22:08:06 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas5p2.samsung.com (KnoxPortal) with ESMTPA id 20240521112458epcas5p2bb85b9c58a58dc4eaecf66adc74872bd~RfUweDbmn2405124051epcas5p27; Tue, 21 May 2024 11:24:58 +0000 (GMT) Received: from epsmgmcp1.samsung.com (unknown [182.195.42.82]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20240521112458epsmtrp1d2bcb3f0c350e3b251bfb770bdcdeb76~RfUwdFIUi3228932289epsmtrp1-; Tue, 21 May 2024 11:24:58 +0000 (GMT) X-AuditID: b6c32a44-921fa70000002198-d1-664c9cb627b4 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgmcp1.samsung.com (Symantec Messaging Gateway) with SMTP id E7.3E.19234.A848C466; Tue, 21 May 2024 20:24:58 +0900 (KST) Received: from green245 (unknown [107.99.41.245]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20240521112454epsmtip22650eeb9186dbced84f491fa532014b1~RfUsmvBOT0276702767epsmtip2G; Tue, 21 May 2024 11:24:54 +0000 (GMT) Date: Tue, 21 May 2024 16:47:56 +0530 From: Nitesh Shetty To: Bart Van Assche Cc: Jens Axboe , Jonathan Corbet , Alasdair Kergon , Mike Snitzer , Mikulas Patocka , Keith Busch , Christoph Hellwig , Sagi Grimberg , Chaitanya Kulkarni , Alexander Viro , Christian Brauner , Jan Kara , martin.petersen@oracle.com, david@fromorbit.com, hare@suse.de, damien.lemoal@opensource.wdc.com, anuj20.g@samsung.com, joshi.k@samsung.com, nitheshshetty@gmail.com, gost.dev@samsung.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, dm-devel@lists.linux.dev, linux-nvme@lists.infradead.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v20 02/12] Add infrastructure for copy offload in block and request layer. Message-ID: <20240521111756.w4xckwbecfyjtez7@green245> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: <086804a4-daa4-48a3-a7db-1d38385df0c1@acm.org> User-Agent: NeoMutt/20171215 X-Brightmail-Tracker: H4sIAAAAAAAAA01TezBcZxTvd++6u2Q2vZaMDymyeRNiPTafCO0M07kSndGmMtNMM5sde1nF 7s4+SkRbETRMEY80zWa9tkSCUrJVr5RSBE1NZkuRoDU2LUYkJogI6a4lk/9+53fO73y/75w5 LJxTy3RgRUuUtFwijOUSVoyGzoP73Rs0oZGeaU+9UG1fN45SLq/hqGosh0CznQsAfftkBUdT 7V8DtHpvAEe67nGASrSFDDTS3oShVm0ehm5VdWHo+tWLGOp6NUegvI4hgAyDagzdGXVDpell DNR6p5eB9M0aAhXfMDBRRc86hnIvDWKoceoCQDWz8wx0d9QRDaz1WLznSOn/PEH1aSHVpB5j UgPjdQxKf09F1VdmENTtsq+o/25fA1TLSDJBfZ+db0FlXXxMUE1pExbUU8Mog5r/ZZCgsnWV gPq95DdmmM3pmGNiWiii5S60JEIqipZEBXBPnBQECXz5njx3nh86wnWRCOPoAG5waJj7+9Gx xuFwXT4XxqqMVJhQoeAeDjwml6qUtItYqlAGcGmZKFbmI/NQCOMUKkmUh4RWHuV5enr5GgvP xogb0rWY7IVtwlJzLpYMdNaZwJIFSR84cv8HPBOwWByyBUDtvkxgZYQLANbq9eB10J9TwdwS PLs0yTAnmgAcXL5JmINHAD6sS96oYpB7YftLjYWpLUG6wf5XLBNtSx6AS39XbIhxspSAD4ef 46aEDXkWzvXlbtSzST7MNahMNJu0hr3XphgmbEn6w67Gn4AJ7yB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fVTaPvi2rGD3OLDjCHiAc xWWTkpqTWZZapG+XwJXxseE7a8EaoYoF83ayNDA28HcxcnJICJhIfOl4xNLFyMUhJLCdUaLx ehsTREJSYtnfI8wQtrDEyn/P2SGKnjBK3F7RC1bEIqAqceDPHNYuRg4ONgFtidP/OUDCIgIa Et8eLAcbyiywlE3i4v7f7CAJYYEEibenJoLV8wqYSUx8Wgox8x2jxIy929hAangFBCVOznzC AmIzA9XM2/yQGaSeWUBaYvk/sPmcAtYSR3dsZQSxRQVkJGYs/co8gVFwFpLuWUi6ZyF0L2Bk XsUomlpQnJuem1xgqFecmFtcmpeul5yfu4kRnCa0gnYwLlv/V+8QIxMH4yFGCQ5mJRHeTVs8 04R4UxIrq1KL8uOLSnNSiw8xSnOwKInzKud0pggJpCeWpGanphakFsFkmTg4pRqY4o5ummdb u4zl7uk9GxfpLt/u4eenaWH692rU6sXfVOfMV9/PMevXmWXLD/NKVaZ3estc1qyIVDrzZfWG qVP8DoWvUnCfdkfkyJwDJ/NOi2dt39r8U+E0X/L1478Xcpnk1R05H67zaDmT9oKl3DXfLWe0 WBrYvTq4U+W4SnD1t0Xbl7rIfTwswL69fWH16oeuj6avbOo7q5hevHr3wfQ3kf+yMjl3sD+8 pf9YKv/sO/XukDUu8+flTy9zMw/+Yt+ler5R0Ku7e973iKl63a+OlC68Ot98WZDyxX195u83 Ol0XObgi1ov5zvmsn89c3Y8WGHYx7CvdqL1YXFJvUfuCtQ+lN8dOvhes067T+pSn6oQSS3FG oqEWc1FxIgCBWrltggMAAA== X-CMS-MailID: 20240521112458epcas5p2bb85b9c58a58dc4eaecf66adc74872bd X-Msg-Generator: CA Content-Type: multipart/mixed; boundary="----Fualeei1.f5fhWGYL679EBd0hH5-OLgtfrOtH6wInDZGwDEe=_15778_" X-Sendblock-Type: REQ_APPROVE CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20240520102842epcas5p4949334c2587a15b8adab2c913daa622f References: <20240520102033.9361-1-nj.shetty@samsung.com> <20240520102033.9361-3-nj.shetty@samsung.com> <086804a4-daa4-48a3-a7db-1d38385df0c1@acm.org> ------Fualeei1.f5fhWGYL679EBd0hH5-OLgtfrOtH6wInDZGwDEe=_15778_ Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Disposition: inline On 20/05/24 04:00PM, Bart Van Assche wrote: >On 5/20/24 03:20, Nitesh Shetty wrote: >>Upon arrival of source bio we merge these two bio's and send >>corresponding request down to device driver. > >bios with different operation types must not be merged. > Copy is a composite operation which has two operation read and write combined, so we chose two operation types which reflects that. >>+static enum bio_merge_status bio_attempt_copy_offload_merge(struct request *req, >>+ struct bio *bio) >>+{ >>+ if (req->__data_len != bio->bi_iter.bi_size) >>+ return BIO_MERGE_FAILED; >>+ >>+ req->biotail->bi_next = bio; >>+ req->biotail = bio; >>+ req->nr_phys_segments++; >>+ req->__data_len += bio->bi_iter.bi_size; >>+ >>+ return BIO_MERGE_OK; >>+} > >This function appends a bio to a request. Hence, the name of this function is >wrong. > We followed the naming convention from discard(bio_attempt_discard_merge) which does similar thing. But we are open to renaming, if overall community also feels the same. >>@@ -1085,6 +1124,8 @@ static enum bio_merge_status blk_attempt_bio_merge(struct request_queue *q, >> break; >> case ELEVATOR_DISCARD_MERGE: >> return bio_attempt_discard_merge(q, rq, bio); >>+ case ELEVATOR_COPY_OFFLOAD_MERGE: >>+ return bio_attempt_copy_offload_merge(rq, bio); >> default: >> return BIO_MERGE_NONE; >> } > >Is any code added in this patch series that causes an I/O scheduler to return >ELEVATOR_COPY_OFFLOAD_MERGE? > yes, blk_try_merge returns ELEVATOR_COPY_OFFLOAD_MERGE. >>+static inline bool blk_copy_offload_mergable(struct request *req, >>+ struct bio *bio) >>+{ >>+ return (req_op(req) == REQ_OP_COPY_DST && >>+ bio_op(bio) == REQ_OP_COPY_SRC); >>+} > >bios with different operation types must not be merged. Please rename this function. > As described above we need two different opcodes. As far as function renaming, we followed discard's naming. But open to any suggestion. >>+static inline bool op_is_copy(blk_opf_t op) >>+{ >>+ return ((op & REQ_OP_MASK) == REQ_OP_COPY_SRC || >>+ (op & REQ_OP_MASK) == REQ_OP_COPY_DST); >>+} > >The above function is not used in this patch. Please introduce new functions in the >patch in which these are used for the first time. > Acked Thank You Nitesh Shetty ------Fualeei1.f5fhWGYL679EBd0hH5-OLgtfrOtH6wInDZGwDEe=_15778_ Content-Type: text/plain; charset="utf-8" ------Fualeei1.f5fhWGYL679EBd0hH5-OLgtfrOtH6wInDZGwDEe=_15778_--