Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp795889lqb; Fri, 24 May 2024 13:34:13 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUTQzH2xkhN+CP81edvTqrqWCfN9yTo19yz/wv4KxmR6u7CMNdm9evR1/vSirpuOBxzXWKLisD4s0O7pYqL9KByJiqA9m3SOh/i92PZSQ== X-Google-Smtp-Source: AGHT+IEl7+/c9fE4YuscQ5zVoTieSBv7LMs7QfjM7ErV6EDRRRCBCNakUeoISTdwUJagL9GsyPk+ X-Received: by 2002:a05:6214:5b8a:b0:6a0:8238:943 with SMTP id 6a1803df08f44-6abcdac1769mr30685516d6.65.1716582853613; Fri, 24 May 2024 13:34:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716582853; cv=pass; d=google.com; s=arc-20160816; b=0xOGxOs/as23uzfL2oogQHXd/00pCgHJ7jJMQXX1LNHSM5i0cmYOs14UGa7xkDax2H th4tyk1yOXvlfswsgLpxxVh5m91c1aMSeEXgT/YnCrKnwBa+iX3+mRnkndA4ZWerhQmT OpxVhCEEOLdSGVzzOEd4CkjSIUg+yotO8nSP4CD7MkUe9GnPUut9svQLtVGD80oaekfA CJxebmLdCBWuIpj9f5D91bYynT+iO4PDGNMGWGYhy0IDAHDjyuQrBoX04P1B8mTZ8Tkq JDg3oKUc7iCCSqBN1sWjY0of8BxEI2439Aq/lWFhXtNkAnpzcvN95emhF3wOnOR9G9x0 370A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=89lfuEma9nN+jYDLe/Yu26+hMarY1kIWqJc2bu+34j0=; fh=3kSadvIci7cDegCuFUDIceLHOFyveQD31FWI/lPNS30=; b=o/1kF+wCfNTQlYthkXFXcvLPL7aGNrY7kyVYx0uqsjuFM8HOnW0i5HOwGlBff8cpM4 Rm4cw+BiEM5Qz34vSsykSbcaGvNvQGRreG2PQlIe3R+XLU/pKXQuZXiXSmEMtGdG1iqX nhV7HwLfdL40fRZOkp6DLtYvk0E2nDdSCRJ0EXonQ9SI+9Qkb7Elrk79DqsfUyTiBRFZ aDg4tjzHGOcKdDQ3TAZTFXF+PnAhCyrSSoY2l/U0yDbTm9sRahCvZVqzPLz4yDbOBhMA kO0g7/uN/IbAaJAgCEkntVbyElnbETzS0mAsXeAbnx7DyMcabhXP0ZpGqvHogfO2eZ5n Xjfg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@acm.org header.s=mr01 header.b=M27wMpgp; arc=pass (i=1 spf=pass spfdomain=acm.org dkim=pass dkdomain=acm.org dmarc=pass fromdomain=acm.org); spf=pass (google.com: domain of linux-kernel+bounces-189091-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-189091-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=acm.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6ac070886dbsi24537536d6.186.2024.05.24.13.34.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 May 2024 13:34:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-189091-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@acm.org header.s=mr01 header.b=M27wMpgp; arc=pass (i=1 spf=pass spfdomain=acm.org dkim=pass dkdomain=acm.org dmarc=pass fromdomain=acm.org); spf=pass (google.com: domain of linux-kernel+bounces-189091-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-189091-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=acm.org 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 3C9041C2144A for ; Fri, 24 May 2024 20:34:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A966284047; Fri, 24 May 2024 20:34:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="M27wMpgp" Received: from 008.lax.mailroute.net (008.lax.mailroute.net [199.89.1.11]) (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 5FCB241C67; Fri, 24 May 2024 20:33:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716582840; cv=none; b=THlLnB5Ewb9NSPjf64PtuTkNcF8b2V5USVNQDicA7VH8eGZT0XY+bMuN86lkJjICipRiIP/I+yWteKMbLhsxo94Q1RMc8qo/fzWb75pSnvBwIVksyRz5wg+2y/waZZUv+xIKRes5cv4TkSU2mrFrtpiVJ+297FYHw9yXRe3Yl3s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716582840; c=relaxed/simple; bh=89lfuEma9nN+jYDLe/Yu26+hMarY1kIWqJc2bu+34j0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=OQPkgAZCemcK4f976JPNpIK3OuI8sqevPqc8etUwEQNBxqmQyNtZEyHnh1jlEc9+/pmNOVexab+8mn3wYHjVNWV5BGliWRFbU5z5xQ/5gmZrCC1fn1pYQHRpGrX+DQpusedRQOlEjODzlFJXjOwS9B4t4xgk7EWj1xxAHfDwL0E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=M27wMpgp; arc=none smtp.client-ip=199.89.1.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Received: from localhost (localhost [127.0.0.1]) by 008.lax.mailroute.net (Postfix) with ESMTP id 4VmGwQ4PPNz6Cnk9V; Fri, 24 May 2024 20:33:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:content-type:content-type:in-reply-to :from:from:content-language:references:subject:subject :user-agent:mime-version:date:date:message-id:received:received; s=mr01; t=1716582828; x=1719174829; bh=89lfuEma9nN+jYDLe/Yu26+h MarY1kIWqJc2bu+34j0=; b=M27wMpgpOKeNFIAKHVb8suAHfQt17wAx1wt9QoRm Nu/5Ed/S7hBQizyRp4kEdJtAe1OXTegKp0LVily/w/yqNA5af1r/IOtEm+Do5cli GjpGy8R80rvjzpvxfK8avBD5h8vt9GMJPTx0KXZDIEtytnIcbNxNaIy/aV67bLUu 92p0S1cfx2fxEvK2F0qQDbmdTRK/6B2Ksd97L3xZZ77G8tq4ngIQ5UpkH+JULSMA 1w5/OxmTDX1UXdo99vpNIqeHi81k2KrC9JTmdsFdbSvwihwhtXyZwUHyJaAYQpVa I7MpY8HfIJeUIkrhcXJBwXuth555oIdftO5h2Yxo484Ejg== X-Virus-Scanned: by MailRoute Received: from 008.lax.mailroute.net ([127.0.0.1]) by localhost (008.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id 9ySzBQtH-Jqr; Fri, 24 May 2024 20:33:48 +0000 (UTC) Received: from [100.96.154.26] (unknown [104.132.0.90]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 008.lax.mailroute.net (Postfix) with ESMTPSA id 4VmGw54jRCz6Cnk9B; Fri, 24 May 2024 20:33:41 +0000 (UTC) Message-ID: Date: Fri, 24 May 2024 13:33:39 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v20 02/12] Add infrastructure for copy offload in block and request layer. To: Nitesh Shetty , Jens Axboe , Jonathan Corbet , Alasdair Kergon , Mike Snitzer , Mikulas Patocka , Keith Busch , Christoph Hellwig , Sagi Grimberg , Chaitanya Kulkarni , Alexander Viro , Christian Brauner , Jan Kara Cc: 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 References: <20240520102033.9361-1-nj.shetty@samsung.com> <20240520102033.9361-3-nj.shetty@samsung.com> Content-Language: en-US From: Bart Van Assche In-Reply-To: <20240520102033.9361-3-nj.shetty@samsung.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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? 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 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) Thanks, Bart.