From: Hannes Reinecke <hare@suse.de>
To: Christoph Hellwig <hch@infradead.org>,
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: Sun, 23 Mar 2025 14:39:25 +0100 [thread overview]
Message-ID: <107a8fbf-c36d-4870-be86-ec1415139cab@suse.de> (raw)
In-Reply-To: <Z9-oaC3lVIMQ4rUF@infradead.org>
On 3/23/25 07:21, Christoph Hellwig wrote:
> 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.
>
Can we have a session around this?
IE define how iterators should be used, and what the iterator elements
should be. If we do it properly this will also fix the frozen page
discussion we're having; if we define iterators whose data elements
are _not_ pages then clearly one cannot take a reference to them.
But in either case, we should define the long-term goal such that
people can start converting stuff.
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@suse.de +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
next prev parent reply other threads:[~2025-03-23 13:39 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-21 16:14 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 ` [RFC PATCH 0/4] iov_iter: Add composite, scatterlist and skbuff iterator types Christoph Hellwig
2025-03-23 13:39 ` Hannes Reinecke [this message]
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=107a8fbf-c36d-4870-be86-ec1415139cab@suse.de \
--to=hare@suse.de \
--cc=christian@brauner.io \
--cc=chuck.lever@oracle.com \
--cc=dhowells@redhat.com \
--cc=hch@infradead.org \
--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