Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp446069lqb; Tue, 28 May 2024 23:34:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUz+yfI3HX/3x/IvotrWUjTLIJZdRDLEsJ8EZv9ECBZhn4j3aq4m9XioLAeca8OZC346dQt0zaTYAO2E9b5AE9o+gDXjg94TGS9Hz25bg== X-Google-Smtp-Source: AGHT+IEyAMFV25W05wLrJQQvcfH9Z56hPgmD524oZ9kSIKqiG9yVK6ToKJEMyM3H9MKqHcUfOmyX X-Received: by 2002:a05:6214:2b9a:b0:6a3:5d84:e0a8 with SMTP id 6a1803df08f44-6abbbc5e9femr163209056d6.9.1716964474330; Tue, 28 May 2024 23:34:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716964474; cv=pass; d=google.com; s=arc-20160816; b=x9jdV7WSmRTvovdSrbN0LshxAzdryYpgRweGpZC0CloSWADWt3tgaFxQNyFgzIrrb5 SXuUUYT9Km9CkQb+0zgJuVjQNPEvTjdBdRcnqz6L/rgdi4PVyjLl8+q/0g+Do1wenUr1 xXVs99qT1fXlJe5rsvLEWTS/8eYE4oeB1QFtJGW2LED6xrVLt2NicmzGykyuguKJs5xO 64wuZKU7+Iv4eoXUVmv1AdDiVh1s3YsXJFqIyJvvU2wNWQhqB/ES5CH5Hp+/MErtyUBs StoHveKwr4e4eB4Sz+CifkbG2nHZfrdLlAWs/epgEMcrc1YsbuMdhMH1aOR8Jdn6+Z2x PbMg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:dlp-filter:cms-type:in-reply-to:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:subject:cc:to :from:date:dkim-signature:dkim-filter:message-id; bh=NsZzfbV06rLVjw7w9bEi8ENxd4QN9ta1b5bIXmsHmVs=; fh=YLd9IbdBOj0P4PR96j+f2rfPLb7/dchyclgdvoY1PWc=; b=r92vbNevM2n9Vwxzw7vhPLMIp1noW1Fsc8l4HZV94LktqS0LmfIJK+vw49x9aLBW1N AeSKenrwUteq8Y1t+/eTdN8/XzkPJufBb6An1emNxuc7T9XDK6ChyDnJfSappx2KM3Nv m19+thiiOi0pkRKOvzaIz/9M72JaRqg884xH59jZdUhJ4gNCBt48VLYs/mvngnRQi5NX 9CCj+BuiaqHv8dRaPMmYyvpXXB3xopI8qNF5j8+E+WG8ZVHgxui9UvcwshX2phrQkIVb v4L34ltob/LyuoPkKAJV+qiNb5TLYQIhKvZJ8tJQ3qMDifcSZxqVM/s1IFXXDc+O82CL caBA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=KPzAStJm; 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-193521-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-193521-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 6a1803df08f44-6ac070f0e0dsi120280926d6.307.2024.05.28.23.34.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 23:34:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-193521-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=KPzAStJm; 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-193521-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-193521-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Message-ID: <6656cc7a.050a0220.d15d9.9bc8SMTPIN_ADDED_BROKEN@mx.google.com> X-Google-Original-Message-ID: <20240529061736.rubnzwkkavgsgmie@nj.shetty@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 ny.mirrors.kernel.org (Postfix) with ESMTPS id E193E1C23514 for ; Wed, 29 May 2024 06:34:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4C40D160797; Wed, 29 May 2024 06:34:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="KPzAStJm" Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) (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 34C9915B99B for ; Wed, 29 May 2024 06:34:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.254.224.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716964454; cv=none; b=V55q03FxLVs7Wlv0171VVRKPzpHkxY+EdyWnvg0bAsejExO8Invw5Zu+SgZeSburJyPrW4FFLo2ummwP4Ujly6LgRktfBA21tcKU0uEq8CIYFve90Ppgq550xqnXvmBem/A7FBIVMO5xKlrdPP3Ft4zhFc8c2uG1/SGi1Y+Omg4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716964454; c=relaxed/simple; bh=NsZzfbV06rLVjw7w9bEi8ENxd4QN9ta1b5bIXmsHmVs=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:In-Reply-To: Content-Type:References; b=KCmVYAJtqe1ROvbzAAqzOZQWBJTDUNgyc0DJmgnwtfEdLad1zTdyjcqH1xwJvkUSuoBQPkFpSWWj8NdK1zq7FhWSt+jtYkvkuso50cVRife2/NJrIlbhQ2cpYHuL4A68vqeeATAn8XGxLsB08cd38SB6oO3prcNRH99BclzXCfk= 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=KPzAStJm; arc=none smtp.client-ip=203.254.224.34 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 epcas5p1.samsung.com (unknown [182.195.41.39]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20240529063410epoutp0472cf3191d93f9dc630bbcd5f5d26b83b~T4hILUmpR0188201882epoutp04S for ; Wed, 29 May 2024 06:34:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20240529063410epoutp0472cf3191d93f9dc630bbcd5f5d26b83b~T4hILUmpR0188201882epoutp04S DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1716964450; bh=NsZzfbV06rLVjw7w9bEi8ENxd4QN9ta1b5bIXmsHmVs=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=KPzAStJm81IIWFHBjGYYT3sAf9/t9O1m+nKO/iQQOcUxAhJN64KEBQRkGJEvo8dHy OlmKX7NMGK9xd8QErxb2LR/sSYkypsvHiqMUlzvMmcdIZEXl3CLLMSa6daD7cSToAv ty+haNNJ6altNKNaapd7BVDqWYj5OMe+opqfiLgc= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas5p3.samsung.com (KnoxPortal) with ESMTP id 20240529063409epcas5p369e3e08e61e1803a1c01b61eff6512e0~T4hHdSVi11875018750epcas5p3u; Wed, 29 May 2024 06:34:09 +0000 (GMT) Received: from epsmges5p2new.samsung.com (unknown [182.195.38.180]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4Vq03332XYz4x9Q9; Wed, 29 May 2024 06:34:07 +0000 (GMT) Received: from epcas5p3.samsung.com ( [182.195.41.41]) by epsmges5p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 28.84.09989.F5CC6566; Wed, 29 May 2024 15:34:07 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas5p3.samsung.com (KnoxPortal) with ESMTPA id 20240529062441epcas5p35df44836a06016c39d889a70bb41fe55~T4Y2ctZzx0620706207epcas5p3g; Wed, 29 May 2024 06:24:41 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20240529062441epsmtrp1670219f5f568e1de070e9a2af6946b10~T4Y2aSjsA1911319113epsmtrp1O; Wed, 29 May 2024 06:24:41 +0000 (GMT) X-AuditID: b6c32a4a-bffff70000002705-f7-6656cc5ffad1 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 6B.C2.08336.82AC6566; Wed, 29 May 2024 15:24:41 +0900 (KST) Received: from nj.shetty?samsung.com (unknown [107.99.41.245]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20240529062436epsmtip18af8d6e6bfb03e340ee76cb5830a2d09~T4YyWBPL92138321383epsmtip1q; Wed, 29 May 2024 06:24:36 +0000 (GMT) Date: Wed, 29 May 2024 06:17:36 +0000 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. Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: X-Brightmail-Tracker: H4sIAAAAAAAAA01TaVBTVxSe+17yEpTQ1wB6SaaAQabsJLL0Yo21xeW10CmDxZk6diATHoQB kjSPRbvIJlipgCDoGMWy7wIqExbBWhDQAGWmgC1YlLbQUqlCtbUsgzTwoOO/737LPXPOmcPH hRU8ET9KHUfr1IoYCbGJY+hydnYP7T8UIR2/bIUajD04Sj2zjKPa8RwCzXQ9Bejc3AKOJm+d BGhpYBBHTT0PACoqKeSg0VutGGovycNQdW03hi6eT8NQ98pjAuV13gNoakSPoY4xV1ScUcZB 7R13OWio7RKBvq6Y4qHK3hcYyv1yBEMtkykA1c/MctCdMTEaXO7l7hFTQ8MBlLEEUq36cR41 +OAqhxoaiKeu1ZwiqOtlSdT09QuAujGaTFCl2We5VFbaE4JqTX/Ipf6aGuNQszdHCCq7qQZQ /UW3eUGWh6N3qWhFOK2zp9VKTXiUOlIuCTgY6h/q4yuVucv80BsSe7UilpZL9gYGue+PijEN R2KfoIiJN1FBCoaReO7epdPEx9H2Kg0TJ5fQ2vAYrbfWg1HEMvHqSA81HbdTJpXu8DEZw6JV ZbPtXO13wqMjxXMgGfS9kgnM+JD0hjOt3bxMsIkvJG8AmDNczlsVhORTAMsvCljhOYDnqp5x NxJlVZXriQ4AfzF+i7GPZyZXXduai0M6wtSMBTwT8PkE6Qr7VvirtBXpBJ9PVHJW/ThZTMCf fpzHV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iEDnTjQR6E7bEYBudHZT6EGrENW77bzlQtzQuA47siEu073i43rnLQo3 PNLgItNJGhfnHsau4gyAy1uSaZxz5jwPp6V00bjs2Gse7m1vpXB3RRONz5SYAK7Lus/f5LvT O0TGxcX8zanmhO72jh5yvgTKZPbAl/9vEMngsuAU8GIguwDm/mfknwLejA9bDqD9QSZ/1JgI 8933yVHtCwuGOn6EegH8mN7PGzEodjo8mjrwPcQwNDsL1g4zI2c/Ngj2vzFSI3mSzaPh08pB T6kvuxt+cpzzsAJ2FSy42U2NlnYBeOLJY/6oMR4+zGijRjTJLoJXi996BkhWCI1DngEv9k9o NBuos4DV/UbofiN0v4gsQJrARE6plkfJ1RKlRMElitVSuVqjiBLvjZcXAc8zzAy+A26besQ2 QDDABiBDivwEddptkT4CmTTpIKeK36XSxHFqGxAylMhf4O9Kk/mwUdIELpbjlJzqp0swXgHJ xNT5hjmqnpCW0gORYflyqcVWOa1v8HSvZY8scPOLDMPYl9ttE5QfqmJ6/6quOB/vUnhtXexa GSgrujR5WUVdY1oeU6kdPpR4fcAJDCub816Mm/a0OKLuZN+aBk1kaHBi//zWDSvG1QZuehYx +WDo2A/hYfMMzinXiOdfw9amlkp1G/WZOX1x7uOa/QHUkvH49ZOmz3J/8frai1bJDt5HMuzf xZ0bTOEzdIUlFy5s0TXHmm36nOtBPIvBDv8QhQRH1SR1pflJGi3iNtPq9Ahxxxe945l5eYbC ql8S5FLbFyalvhswPv5nS6y4zE6+X6rdt79jkjvh9FfhGOvCaPP7t7nzRJQ6WiqZSarU0m/z cG5+ewMAAA== X-CMS-MailID: 20240529062441epcas5p35df44836a06016c39d889a70bb41fe55 X-Msg-Generator: CA Content-Type: multipart/mixed; boundary="----u98hW3AvpxW_WMqzG8XaJinKydZ84Ygy6oP0sovTVoTPagnQ=_119f1_" 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> ------u98hW3AvpxW_WMqzG8XaJinKydZ84Ygy6oP0sovTVoTPagnQ=_119f1_ Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Disposition: inline On 24/05/24 01:33PM, Bart Van Assche wrote: >On 5/20/24 03:20, Nitesh Shetty wrote: >>We add two new opcode REQ_OP_COPY_DST, REQ_OP_COPY_SRC. >>Since copy is a composite operation involving src and dst sectors/lba, >>each needs to be represented by a separate bio to make it compatible >>with device mapper. >>We expect caller to take a plug and send bio with destination information, >>followed by bio with source information. >>Once the dst bio arrives we form a request and wait for source >>bio. Upon arrival of source bio we merge these two bio's and send >>corresponding request down to device driver. >>Merging non copy offload bio is avoided by checking for copy specific >>opcodes in merge function. > >In this patch I don't see any changes for blk_attempt_bio_merge(). Does >this mean that combining REQ_OP_COPY_DST and REQ_OP_COPY_SRC will never >happen if the QUEUE_FLAG_NOMERGES request queue flag has been set? > Yes, in this case copy won't work, as both src and dst bio reach driver as part of separate requests. We will add this as part of documentation. >Can it happen that the REQ_NOMERGE flag is set by __bio_split_to_limits() >for REQ_OP_COPY_DST or REQ_OP_COPY_SRC bios? Will this happen if the >following condition is met? > >dst_bio->nr_phys_segs + src_bio->nr_phys_segs > max_segments > No, this should not happen. We don't use bio_split_rw for copy. We have added a separate function to check for split incase of copy(bio_split_copy), which doesn't allow copy bio splits, hence REQ_NOMERGE flag won't be set. >Is it allowed to set REQ_PREFLUSH or REQ_FUA for REQ_OP_COPY_DST or >REQ_OP_COPY_SRC bios? I'm asking this because these flags disable merging. > >From include/linux/blk_types.h: > >#define REQ_NOMERGE_FLAGS (REQ_NOMERGE | REQ_PREFLUSH | REQ_FUA) > No, setting these flags won't allow copy bio's to merge and hence copy won't work. We suggest to use helper API blkdev_copy_offload to achieve the copy which won't be setting these flags. Thank You, Nitesh Shetty ------u98hW3AvpxW_WMqzG8XaJinKydZ84Ygy6oP0sovTVoTPagnQ=_119f1_ Content-Type: text/plain; charset="utf-8" ------u98hW3AvpxW_WMqzG8XaJinKydZ84Ygy6oP0sovTVoTPagnQ=_119f1_--