From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="J8DwdIbL" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2785D5C for ; Tue, 21 Nov 2023 16:44:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700613843; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=8EYyCryX7PBKswSadGF3aphue0eBdpRNIdFAo5BTQRU=; b=J8DwdIbLemRJVRG+G2vC9TooBPOY4IbK+Z0PTyKRPrG+wfQPOuiju5lQ4EPKfgGYRFEuE6 ENy+Yd+OQFAVFeOmEfMtl5EElA8ZWgK9Hs65uTlBLCtFfp/bFcGUgGxXzZQ3fG9dlBxNyB f1eTOiYntCu2o36TwfTDCjA1A5M2n74= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-586-Y5BE8AH3Ofu_IuaI0chxBA-1; Tue, 21 Nov 2023 19:43:59 -0500 X-MC-Unique: Y5BE8AH3Ofu_IuaI0chxBA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (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) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D3B4B1C05191; Wed, 22 Nov 2023 00:43:58 +0000 (UTC) Received: from fedora (unknown [10.72.120.8]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2EBA31C060AE; Wed, 22 Nov 2023 00:43:52 +0000 (UTC) Date: Wed, 22 Nov 2023 08:43:48 +0800 From: Ming Lei To: Keith Busch Cc: Keith Busch , linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, io-uring@vger.kernel.org, axboe@kernel.dk, hch@lst.de, joshi.k@samsung.com, martin.petersen@oracle.com, ming.lei@redhat.com Subject: Re: [PATCHv3 1/5] bvec: introduce multi-page bvec iterating Message-ID: References: <20231120224058.2750705-1-kbusch@meta.com> <20231120224058.2750705-2-kbusch@meta.com> Precedence: bulk X-Mailing-List: io-uring@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 On Tue, Nov 21, 2023 at 08:49:45AM -0700, Keith Busch wrote: > On Tue, Nov 21, 2023 at 04:37:01PM +0800, Ming Lei wrote: > > On Mon, Nov 20, 2023 at 02:40:54PM -0800, Keith Busch wrote: > > > From: Keith Busch > > > > > > Some bio_vec iterators can handle physically contiguous memory and have > > > no need to split bvec consideration on page boundaries. > > > > Then I am wondering why this helper is needed, and you can use each bvec > > directly, which is supposed to be physically contiguous. > > It's just a helper function to iterate a generic bvec. I just look into patch 3 about the use, seems what you need is for_each_bvec_all(), which is safe & efficient to use when freeing the host data(bio or bip), but can't be used in split bio/bip, in which the generic iterator is needed. And you can open-code it in bio_integrity_unmap_user(): for (i = 0; i < bip->bip_vcnt; i++) { struct bio_vec *v = &bip->bip_vec[i]; ... } Thanks, Ming