From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by mail19.linbit.com (LINBIT Mail Daemon) with ESMTP id 14BBD160917 for ; Thu, 8 May 2025 12:06:53 +0200 (CEST) Date: Thu, 8 May 2025 03:06:53 -0700 From: Christoph Hellwig To: Christoph Hellwig , Philipp Reisner , Christoph =?iso-8859-1?Q?B=F6hmwalder?= , drbd-dev@lists.linbit.com, linux-block@vger.kernel.org Subject: Re: transferring bvecs over the network in drbd Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: "*Coordination* of development, patches, contributions -- *Questions* \(even to developers\) go to drbd-user, please." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Thu, May 08, 2025 at 10:39:56AM +0200, Lars Ellenberg wrote: > For async replication, we want to actually copy data into send buffer, > we cannot have the network stack hold a reference to a page for which > we signalled io completion already. > > For sync replication we want to avoid additional data copy if possible, > so try to use "zero copy sendpage". I didn't even complain about having both variants :) > > That's why we have two variants of what looks to be the same thing. > > Why we do it that way: probably when we wrote that part, > a better infrastructure was not available, or we were not aware of it. Yes. While the iov_iter and the bvec version of have been around for a long time, drbd probably still predates them. > Thanks for the pointers, we'll look into it. > Using more efficient ways to do stuff sounds good. thanks. Note that now that ->sendpage has been replaced with the MSG_SPLICE_PAGES flag you can actually share most code for both variants as well.