Re: [PATCH 0/2] mm/fs: put_user_page() proposal

2018-07-10 Thread Jan Kara
On Mon 09-07-18 13:00:49, Matthew Wilcox wrote: > On Mon, Jul 09, 2018 at 09:47:40PM +0200, Jan Kara wrote: > > On Mon 09-07-18 10:16:51, Matthew Wilcox wrote: > > > > 2) What to do when some page is pinned but we need to do e.g. > > > > clear_page_dirty_for_io(). After some more thinking I agree w

Re: [PATCH 0/2] mm/fs: put_user_page() proposal

2018-07-10 Thread Jan Kara
On Mon 09-07-18 13:56:57, Jason Gunthorpe wrote: > On Mon, Jul 09, 2018 at 09:47:40PM +0200, Jan Kara wrote: > > On Mon 09-07-18 10:16:51, Matthew Wilcox wrote: > > > On Mon, Jul 09, 2018 at 06:08:06PM +0200, Jan Kara wrote: > > > > On Mon 09-07-18 18:49:37, Nicholas Piggin wrote: > > > > > The pro

Re: [PATCH 0/2] mm/fs: put_user_page() proposal

2018-07-09 Thread Matthew Wilcox
On Mon, Jul 09, 2018 at 09:47:40PM +0200, Jan Kara wrote: > On Mon 09-07-18 10:16:51, Matthew Wilcox wrote: > > > 2) What to do when some page is pinned but we need to do e.g. > > > clear_page_dirty_for_io(). After some more thinking I agree with you that > > > just blocking waiting for page to unp

Re: [PATCH 0/2] mm/fs: put_user_page() proposal

2018-07-09 Thread Jason Gunthorpe
On Mon, Jul 09, 2018 at 09:47:40PM +0200, Jan Kara wrote: > On Mon 09-07-18 10:16:51, Matthew Wilcox wrote: > > On Mon, Jul 09, 2018 at 06:08:06PM +0200, Jan Kara wrote: > > > On Mon 09-07-18 18:49:37, Nicholas Piggin wrote: > > > > The problem with blocking in clear_page_dirty_for_io is that the f

Re: [PATCH 0/2] mm/fs: put_user_page() proposal

2018-07-09 Thread Jan Kara
On Mon 09-07-18 10:16:51, Matthew Wilcox wrote: > On Mon, Jul 09, 2018 at 06:08:06PM +0200, Jan Kara wrote: > > On Mon 09-07-18 18:49:37, Nicholas Piggin wrote: > > > The problem with blocking in clear_page_dirty_for_io is that the fs is > > > holding the page lock (or locks) and possibly others to

Re: [PATCH 0/2] mm/fs: put_user_page() proposal

2018-07-09 Thread Matthew Wilcox
On Mon, Jul 09, 2018 at 06:08:06PM +0200, Jan Kara wrote: > On Mon 09-07-18 18:49:37, Nicholas Piggin wrote: > > The problem with blocking in clear_page_dirty_for_io is that the fs is > > holding the page lock (or locks) and possibly others too. If you > > expect to have a bunch of long term refere

Re: [PATCH 0/2] mm/fs: put_user_page() proposal

2018-07-09 Thread Jan Kara
Hi, On Mon 09-07-18 01:05:52, john.hubb...@gmail.com wrote: > From: John Hubbard > > 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

Re: [PATCH 0/2] mm/fs: put_user_page() proposal

2018-07-09 Thread Jan Kara
On Mon 09-07-18 18:49:37, Nicholas Piggin wrote: > On Mon, 9 Jul 2018 01:05:52 -0700 > john.hubb...@gmail.com wrote: > > > From: John Hubbard > > > > Hi, > > > > With respect to tracking get_user_pages*() pages with page->dma_pinned* > > fields [1], I spent a few days retrofitting most of the

Re: [PATCH 0/2] mm/fs: put_user_page() proposal

2018-07-09 Thread Nicholas Piggin
On Mon, 9 Jul 2018 01:05:52 -0700 john.hubb...@gmail.com wrote: > From: John Hubbard > > 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_p

[PATCH 0/2] mm/fs: put_user_page() proposal

2018-07-09 Thread john . hubbard
From: John Hubbard 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 i