[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aFlcPOpajICfVlFE@infradead.org>
Date: Mon, 23 Jun 2025 06:53:00 -0700
From: Christoph Hellwig <hch@...radead.org>
To: David Howells <dhowells@...hat.com>
Cc: Andrew Lunn <andrew@...n.ch>, Eric Dumazet <edumazet@...gle.com>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
David Hildenbrand <david@...hat.com>,
John Hubbard <jhubbard@...dia.com>,
Christoph Hellwig <hch@...radead.org>, willy@...radead.org,
Christian Brauner <brauner@...nel.org>,
Al Viro <viro@...iv.linux.org.uk>,
Miklos Szeredi <mszeredi@...hat.com>, torvalds@...ux-foundation.org,
netdev@...r.kernel.org, linux-mm@...ck.org,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: AF_UNIX/zerocopy/pipe/vmsplice/splice vs FOLL_PIN
On Mon, May 12, 2025 at 03:51:30PM +0100, David Howells wrote:
> I'm looking at how to make sendmsg() handle page pinning - and also working
> towards supporting the page refcount eventually being removed and only being
> available with certain memory types.
Yes, that would be great.
> The question is what should happen here to a memory span for which the network
> layer or pipe driver is not allowed to take reference, but rather must call a
> destructor? Particularly if, say, it's just a small part of a larger span.
What is a "span" in this context? In general splice unlike direct I/O
relies on page reference counts inside the splice machinery. But that is
configurable through the pipe_buf_operations. So if you want something
to be handled by splice that does not use simple page refcounts you need
special pipe_buf_operations for it. And you'd better have a really good
use case for this to be worthwhile.
> And then there's vmsplice(). The same goes for vmsplice() to AF_UNIX or to a
> pipe. That should also pin memory. It may also be possible to vmsplice a
> pinned page into the target process's VM or a page from a memory span with
> some other type of destruction. I don't suppose we can deprecate vmsplice()?
You'll need a longterm pin for vmsplice. I'd love to deprecate it,
but I doubt it's going to go away any time soon if ever.
Powered by blists - more mailing lists