LKML Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 0/2] mm/fs: put_user_page() proposal
@ 2018-07-09  8:05 john.hubbard
  2018-07-09  8:05 ` [PATCH 1/2] mm: introduce put_user_page(), placeholder version john.hubbard
                   ` (3 more replies)
  0 siblings, 4 replies; 16+ messages in thread
From: john.hubbard @ 2018-07-09  8:05 UTC (permalink / raw)
  To: Matthew Wilcox, Michal Hocko, Christopher Lameter,
	Jason Gunthorpe, Dan Williams, Jan Kara, Al Viro
  Cc: linux-mm, LKML, linux-rdma, linux-fsdevel, John Hubbard

From: John Hubbard <jhubbard@nvidia.com>

Hi,

With respect to tracking get_user_pages*() pages with page->dma_pinned*
fields [1], I spent a few days retrofitting most of the get_user_pages*()
call sites, by adding calls to a new put_user_page() function, in place
of put_page(), where appropriate. This will work, but it's a large effort.

Design note: I didn't see anything that hinted at a way to fix this
problem, without actually changing all of the get_user_pages*() call sites,
so I think it's reasonable to start with that.

Anyway, it's still incomplete, but because this is a large, tree-wide
change (that will take some time and testing), I'd like to propose a plan,
before spamming zillions of people with put_user_page() conversion patches.
So I picked out the first two patches to show where this is going.

Proposed steps:

Step 1:

Start with the patches here, then continue with...dozens more.
This will eventually convert all of the call sites to use put_user_page().
This is easy in some places, but complex in others, such as:

    -- drivers/gpu/drm/amd
    -- bio
    -- fuse
    -- cifs
    -- anything from:
           git grep  iov_iter_get_pages | cut -f1 -d ':' | sort | uniq

The easy ones can be grouped into a single patchset, perhaps, and the
complex ones probably each need a patchset, in order to get the in-depth
review they'll need.

Furthermore, some of these areas I hope to attract some help on, once
this starts going.

Step 2:

In parallel, tidy up the core patchset that was discussed in [1], (version
2 has already been reviewed, so I know what to do), and get it perfected
and reviewed. Don't apply it until step 1 is all done, though.

Step 3:

Activate refcounting of dma-pinned pages (essentially, patch #5, which is
[1]), but don't use it yet. Place a few WARN_ON_ONCE calls to start
mopping up any missed call sites.

Step 4:

After some soak time, actually connect it up (patch #6 of [1]) and start
taking action based on the new page->dma_pinned* fields.

[1] https://www.spinics.net/lists/linux-mm/msg156409.html

  or, the same thread on LKML if it's working for you:

    https://lkml.org/lkml/2018/7/4/368

John Hubbard (2):
  mm: introduce put_user_page(), placeholder version
  goldfish_pipe/mm: convert to the new put_user_page() call

 drivers/platform/goldfish/goldfish_pipe.c |  6 +++---
 include/linux/mm.h                        | 14 ++++++++++++++
 2 files changed, 17 insertions(+), 3 deletions(-)

-- 
2.18.0


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, back to index

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-09  8:05 [PATCH 0/2] mm/fs: put_user_page() proposal john.hubbard
2018-07-09  8:05 ` [PATCH 1/2] mm: introduce put_user_page(), placeholder version john.hubbard
2018-07-09 10:08   ` kbuild test robot
2018-07-09 18:48     ` John Hubbard
2018-07-09 15:53   ` Jason Gunthorpe
2018-07-09 16:11     ` Jan Kara
2018-07-09  8:05 ` [PATCH 2/2] goldfish_pipe/mm: convert to the new put_user_page() call john.hubbard
2018-07-09  8:49 ` [PATCH 0/2] mm/fs: put_user_page() proposal Nicholas Piggin
2018-07-09 16:08   ` Jan Kara
2018-07-09 17:16     ` Matthew Wilcox
2018-07-09 19:47       ` Jan Kara
2018-07-09 19:56         ` Jason Gunthorpe
2018-07-10  7:51           ` Jan Kara
2018-07-09 20:00         ` Matthew Wilcox
2018-07-10  8:21           ` Jan Kara
2018-07-09 16:27 ` Jan Kara

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git
	git clone --mirror https://lore.kernel.org/lkml/7 lkml/git/7.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org linux-kernel@archiver.kernel.org
	public-inbox-index lkml


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox