From: Christoph Hellwig <hch@infradead.org>
To: David Howells <dhowells@redhat.com>
Cc: Leon Romanovsky <leonro@nvidia.com>,
Christian Brauner <christian@brauner.io>,
Matthew Wilcox <willy@infradead.org>,
Chuck Lever <chuck.lever@oracle.com>,
Steve French <smfrench@gmail.com>,
Ilya Dryomov <idryomov@gmail.com>,
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
Date: Sat, 22 Mar 2025 23:21:28 -0700 [thread overview]
Message-ID: <Z9-oaC3lVIMQ4rUF@infradead.org> (raw)
In-Reply-To: <20250321161407.3333724-1-dhowells@redhat.com>
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.
next prev parent reply other threads:[~2025-03-23 6:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-21 16:14 [RFC PATCH 0/4] iov_iter: Add composite, scatterlist and skbuff iterator types David Howells
2025-03-21 16:14 ` [RFC PATCH 1/4] iov_iter: Move ITER_DISCARD and ITER_XARRAY iteration out-of-line David Howells
2025-03-21 16:14 ` [RFC PATCH 2/4] iov_iter: Add an iterator-of-iterators David Howells
2025-03-21 16:14 ` [RFC PATCH 3/4] iov_iter: Add a scatterlist iterator type David Howells
2025-03-21 16:14 ` [RFC PATCH 4/4] iov_iter: Add a scatterlist iterator type [INCOMPLETE] David Howells
2025-03-23 6:21 ` Christoph Hellwig [this message]
2025-03-23 13:39 ` [RFC PATCH 0/4] iov_iter: Add composite, scatterlist and skbuff iterator types Hannes Reinecke
2025-03-23 14:35 ` Matthew Wilcox
2025-03-23 14:33 ` Matthew Wilcox
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z9-oaC3lVIMQ4rUF@infradead.org \
--to=hch@infradead.org \
--cc=christian@brauner.io \
--cc=chuck.lever@oracle.com \
--cc=dhowells@redhat.com \
--cc=idryomov@gmail.com \
--cc=leonro@nvidia.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=netfs@lists.linux.dev \
--cc=smfrench@gmail.com \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).