linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: David Hildenbrand <david@redhat.com>
Cc: dhowells@redhat.com, "Teterevkov, Ivan" <Ivan.Teterevkov@amd.com>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"jhubbard@nvidia.com" <jhubbard@nvidia.com>,
	"jack@suse.cz" <jack@suse.cz>,
	"rppt@linux.ibm.com" <rppt@linux.ibm.com>,
	"jglisse@redhat.com" <jglisse@redhat.com>,
	"ira.weiny@intel.com" <ira.weiny@intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Christoph Hellwig <hch@lst.de>,
	Matthew Wilcox <willy@infradead.org>
Subject: Re: find_get_page() VS pin_user_pages()
Date: Wed, 12 Apr 2023 09:41:07 +0100	[thread overview]
Message-ID: <37946.1681288867@warthog.procyon.org.uk> (raw)
In-Reply-To: <93f2614e-4521-8bc8-2eca-e7ad03e7e399@redhat.com>

David Hildenbrand <david@redhat.com> wrote:

> I suspect that find_get_page() is not the kind of interface you want to use
> for the purpose you describe. find_get_page() is a wrapper around
> pagecache_get_page() and seems more like a helper for implementing an fs
> (looking at the users and the fact that it only considers pages that are in
> the pagecache).

Btw, at some point we're going to need public functions to get extra pins on
pages.  vmsplice() should be pinning the pages it pushes into a pipe - so all
pages in a pipe should probably be pinned - and anyone who splices a page out
of a pipe and retains it (skbuffs spring strongly to mind) should also get a
pin on the page.

So should all pages held by an skbuff be pinned rather than ref'd?  I have a
patch to use the bottom two bits of an skb frag's page pointer to keep track
of whether the page it points to is ref'd, pinned or neither, but if we can
make it pin/not-pin them, I only need one bit for that.

David



  parent reply	other threads:[~2023-04-12  8:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-11 19:43 find_get_page() VS pin_user_pages() Teterevkov, Ivan
2023-04-11 23:38 ` Alistair Popple
2023-04-12  9:04   ` Teterevkov, Ivan
2023-04-12 10:41     ` Jan Kara
2023-04-12 12:13       ` Teterevkov, Ivan
2023-04-12  8:17 ` David Hildenbrand
2023-04-12  9:43   ` Teterevkov, Ivan
2023-04-12  8:41 ` David Howells [this message]
2023-04-13 12:41   ` David Hildenbrand

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=37946.1681288867@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=Ivan.Teterevkov@amd.com \
    --cc=david@redhat.com \
    --cc=hch@lst.de \
    --cc=ira.weiny@intel.com \
    --cc=jack@suse.cz \
    --cc=jglisse@redhat.com \
    --cc=jhubbard@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rppt@linux.ibm.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).