From mboxrd@z Thu Jan 1 00:00:00 1970 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4750C28B30 for ; Sun, 23 Mar 2025 06:21:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1E4E8280002; Sun, 23 Mar 2025 02:21:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 196CB280001; Sun, 23 Mar 2025 02:21:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0854E280002; Sun, 23 Mar 2025 02:21:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id E0608280001 for ; Sun, 23 Mar 2025 02:21:34 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 6581959642 for ; Sun, 23 Mar 2025 06:21:36 +0000 (UTC) X-FDA: 83251819392.03.718227B Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf14.hostedemail.com (Postfix) with ESMTP id 07874100008 for ; Sun, 23 Mar 2025 06:21:32 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=3zRY+YvN; spf=none (imf14.hostedemail.com: domain of BATV+ed0233cd66847c7f3957+7882+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+ed0233cd66847c7f3957+7882+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1742710894; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=L1ic8gyVxVIspX+A5ncCA9aQdUq2VzF6Q97RWcvY5wU=; b=yV/xzZheflDfcxG30JPJHx7gYZaqc4IK27xGI/YjCwAscA7/46qstY4RwDE9cVpEyDwowW XPf+oSRZa22bZoJPZ3iNJxchptOhK+wBheVRDNIn7LBrdQPg9Zq7mI4qrDbWNZw4uWtHVv p4+JV/R3mNSMFZ6eHmCdd2dlUTAVsYs= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=3zRY+YvN; spf=none (imf14.hostedemail.com: domain of BATV+ed0233cd66847c7f3957+7882+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+ed0233cd66847c7f3957+7882+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1742710894; a=rsa-sha256; cv=none; b=1rEdyHAYkPOr7rBmCSV1o1VBkyk6ISjzDU0Fk7lAY5dJopxjtucjOPzdDBjkZLt8+Aj5cb USwyocU6bxOzZ49cbacxkQi0a9HRS6aheZyPU+xH2tZdobxCY6rMB0GLLHlPlYDWb8tnpy TimdcYZLzig3pNYnKXbmFKezL7SjNR0= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=L1ic8gyVxVIspX+A5ncCA9aQdUq2VzF6Q97RWcvY5wU=; b=3zRY+YvNGQUSC9kOV3Jx4UErEG BG2L8v7UKQkhm6NoDW6WlXMruVLMyVUMjWnIMhIgd8GZ1QZX0ouyX0SfxR5/QXAgpqPWlo8gqaeVz PeoEtDOV58uSXA47JCHXsGbQMIqFrxtHUe6yKOcls61I8vP7y6CdL3EHZRPUrb1vc5P9CxDHhF+xj Q6DGKhTJKQ1cxKDSIX7q+KJbjoqTUM7bOJysVABJzoLMlcNNIyzGuowJOv4RI7PHcUZ0TGoYhuuqb bN5ClG2A7KLuDc+ZdIpUqH1CmOv17eDsPFOQz3gZ3IfJUMpeQ8in9Gf1gdvg3AwGZostRzNyA+o20 vQQgnhbg==; Received: from hch by bombadil.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1twEi8-00000000kzq-0yMV; Sun, 23 Mar 2025 06:21:28 +0000 Date: Sat, 22 Mar 2025 23:21:28 -0700 From: Christoph Hellwig To: David Howells Cc: Leon Romanovsky , Christian Brauner , Matthew Wilcox , Chuck Lever , Steve French , Ilya Dryomov , netfs@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 0/4] iov_iter: Add composite, scatterlist and skbuff iterator types Message-ID: References: <20250321161407.3333724-1-dhowells@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250321161407.3333724-1-dhowells@redhat.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Rspamd-Queue-Id: 07874100008 X-Rspamd-Server: rspam05 X-Rspam-User: X-Stat-Signature: kjxcdo7zasryses6wn4occ1rwfy8akdp X-HE-Tag: 1742710892-877074 X-HE-Meta: U2FsdGVkX18afzHkO6xBgkOOPfyk9T5jsGW/IG2m/KflDBgT873m55FhAu1/ZQTcJyKjgA3YmhbbAL90q0EZCFnkd4lTCisVUoUo4WK9wKlfSTb8P6f+qsShDhw8iRjd7B3yUcjK1kmgt0tEummpstuSAu/iKmM+wC8+vLjhaSmqwAlssuEee3HwqvO/MCQt8VS2/8llh8TCVS5H4DUf/2rrLCCszw9CYk28FPR4MeMjcNEDmoXR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/4OFv1VpZF/X+HsdvwFyh7o7taKlHkREBer6KKnFyp59w5J9BQxEVZPF4gswNfXi+OsuyJNFsSLktNbnwLwM+bqqmAHRb9LEo2d9BJrdxUa1qzLzEDMyLRKhgMJ4U7mPWJZr5uE/dwnQVTVWVm7Db+3M1tAkDI07EWNmCryteFSpr0qoJbhs1YZbcrD8QW0wt1ZEo/Y6viL4w== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: This is going entirely in the wrong direction. We don't need more iter types but less. The reason why we have to many is because the underlying representation of the ranges is a mess which goes deeper than just the iterator, because it also means we have to convert between the underlying representations all the time. E.g. the socket code should have (and either has for a while or at least there were patches) been using bio_vecs instead of reinventing them as sk fragment. The crypto code should not be using scatterlists, which are a horrible data structure because they mix up the physical memory description and the dma mapping information which isn't even used for most uses, etc. So instead of more iters let's convert everyone to a common scatter/gather memory definition, which simplifies the iters. For now that is the bio_vec, which really should be converted from storing a struct page to a phys_addr_t (and maybe renamed if that helps adoption). That allows to trivially kill the kvec for example. As for the head/tail - that seems to be a odd NFS/sunrpc fetish. I've actually started a little project to just convert the sunrpc code to use bio_vecs, which massively simplifies the code, and allows directly passing it to the iters in the socket API. It doesn't quite work yet but shows how all these custom (and in this case rather ad-hoc) memory fragment representation cause a huge mess. I don't think the iterlist can work in practice, but it would be nice to have for a few use cases. If it worked it should hopefully allow to kill off the odd xarray iterator.