Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6E73AC433EF for ; Sat, 18 Jun 2022 15:33:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233887AbiFRPdZ (ORCPT ); Sat, 18 Jun 2022 11:33:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232320AbiFRPdM (ORCPT ); Sat, 18 Jun 2022 11:33:12 -0400 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9A035FD4 for ; Sat, 18 Jun 2022 08:32:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=DjvxjPfEjRUB4qcuA9PsUne8+aihnF1fbW3fpzGSyZU=; b=AwwlKQxY/S7JqrNPg1Fq/HFFy7 dP1KaJ8LtXvDGrGc3o2h1+2MMgkXvgIgOpQgrUHpuswBoJMbRI5mgrHqBxFlPverHNgD14khGKrYm QFaTvBM280XirAj1CBNxmoSXG7ZX8YLAuiAjUrr4pKqHapsqE/p0ZEazaUxW2+IZjYf+1F5SNHY+0 FX1iI9tfZcVpHEGA/YBqvF6f/bhbVFDuvI/04BlbCpas2gUkOAIAjyH31pazlBHy9I1RSqbpFBNZi cX5SN3stvpNBOKN69lVzdVQZcZLtNcv5m1ASsw+C57ZdLvzPADuQQjZ0ESTpAAtJ56jj0XiBi6oDh zpvB2Shw==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.95 #2 (Red Hat Linux)) id 1o2aRV-001db1-QE; Sat, 18 Jun 2022 15:32:58 +0000 Date: Sat, 18 Jun 2022 16:32:57 +0100 From: Al Viro To: Jens Axboe Cc: "linux-fsdevel@vger.kernel.org" Subject: Re: [PATCH RFC] iov_iter: import single segments iovecs as ITER_UBUF Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Sat, Jun 18, 2022 at 04:19:24PM +0100, Al Viro wrote: > On Sat, Jun 18, 2022 at 08:08:08AM -0600, Jens Axboe wrote: > > Using an ITER_UBUF is more efficient than an ITER_IOV, and for the single > > segment case, there's no reason to use an ITER_IOV when an ITER_UBUF will > > do. Experimental data collected shows that ~2/3rds of iovec imports are > > single segments, from applications using readv/writev or recvmsg/sendmsg > > that are iovec based. > > > > Explicitly check for nr_segs == 1 and import those as ubuf rather than > > iovec based iterators. > > Hadn't we'd been through that before? There is infinibarf code that > assumes ITER_IOVEC for what its ->write_iter() gets (and yes, that's > the one that has ->write() with different semantics). > > And I wouldn't bet a dime on all ->sendmsg() and ->recvmsg() being > flavour-agnostic either... Incidentally, what will your patch do to one-segment readv(2) from e.g. /proc/self/status? Or anything else that has no ->read_iter, for that matter...