Re: [PATCH v2] mm, zone_device: replace {get, put}_zone_device_page() with a single reference

2017-05-02 Thread Jerome Glisse
On Tue, May 02, 2017 at 02:37:46PM +0300, Kirill A. Shutemov wrote: > On Mon, May 01, 2017 at 09:55:48AM -0400, Jerome Glisse wrote: > > On Mon, May 01, 2017 at 01:23:59PM +0300, Kirill A. Shutemov wrote: > > > On Sun, Apr 30, 2017 at 07:14:24PM -0400, Jerome Glisse wrote: > > > > On Sat, Apr 29,

Re: [PATCH v2] mm, zone_device: replace {get, put}_zone_device_page() with a single reference

2017-05-02 Thread Jerome Glisse
On Tue, May 02, 2017 at 02:37:46PM +0300, Kirill A. Shutemov wrote: > On Mon, May 01, 2017 at 09:55:48AM -0400, Jerome Glisse wrote: > > On Mon, May 01, 2017 at 01:23:59PM +0300, Kirill A. Shutemov wrote: > > > On Sun, Apr 30, 2017 at 07:14:24PM -0400, Jerome Glisse wrote: > > > > On Sat, Apr 29,

Re: [PATCH v2] mm, zone_device: replace {get, put}_zone_device_page() with a single reference

2017-05-02 Thread Kirill A. Shutemov
On Mon, May 01, 2017 at 09:55:48AM -0400, Jerome Glisse wrote: > On Mon, May 01, 2017 at 01:23:59PM +0300, Kirill A. Shutemov wrote: > > On Sun, Apr 30, 2017 at 07:14:24PM -0400, Jerome Glisse wrote: > > > On Sat, Apr 29, 2017 at 01:17:26PM +0300, Kirill A. Shutemov wrote: > > > > On Fri, Apr 28,

Re: [PATCH v2] mm, zone_device: replace {get, put}_zone_device_page() with a single reference

2017-05-02 Thread Kirill A. Shutemov
On Mon, May 01, 2017 at 09:55:48AM -0400, Jerome Glisse wrote: > On Mon, May 01, 2017 at 01:23:59PM +0300, Kirill A. Shutemov wrote: > > On Sun, Apr 30, 2017 at 07:14:24PM -0400, Jerome Glisse wrote: > > > On Sat, Apr 29, 2017 at 01:17:26PM +0300, Kirill A. Shutemov wrote: > > > > On Fri, Apr 28,

Re: [PATCH v2] mm, zone_device: replace {get, put}_zone_device_page() with a single reference

2017-05-01 Thread Jerome Glisse
On Mon, May 01, 2017 at 01:19:24PM -0700, Dan Williams wrote: > On Mon, May 1, 2017 at 6:55 AM, Jerome Glisse wrote: > > On Mon, May 01, 2017 at 01:23:59PM +0300, Kirill A. Shutemov wrote: > >> On Sun, Apr 30, 2017 at 07:14:24PM -0400, Jerome Glisse wrote: > >> > On Sat, Apr

Re: [PATCH v2] mm, zone_device: replace {get, put}_zone_device_page() with a single reference

2017-05-01 Thread Jerome Glisse
On Mon, May 01, 2017 at 01:19:24PM -0700, Dan Williams wrote: > On Mon, May 1, 2017 at 6:55 AM, Jerome Glisse wrote: > > On Mon, May 01, 2017 at 01:23:59PM +0300, Kirill A. Shutemov wrote: > >> On Sun, Apr 30, 2017 at 07:14:24PM -0400, Jerome Glisse wrote: > >> > On Sat, Apr 29, 2017 at

Re: [PATCH v2] mm, zone_device: replace {get, put}_zone_device_page() with a single reference

2017-05-01 Thread Dan Williams
On Mon, May 1, 2017 at 6:55 AM, Jerome Glisse wrote: > On Mon, May 01, 2017 at 01:23:59PM +0300, Kirill A. Shutemov wrote: >> On Sun, Apr 30, 2017 at 07:14:24PM -0400, Jerome Glisse wrote: >> > On Sat, Apr 29, 2017 at 01:17:26PM +0300, Kirill A. Shutemov wrote: >> > > On Fri,

Re: [PATCH v2] mm, zone_device: replace {get, put}_zone_device_page() with a single reference

2017-05-01 Thread Dan Williams
On Mon, May 1, 2017 at 6:55 AM, Jerome Glisse wrote: > On Mon, May 01, 2017 at 01:23:59PM +0300, Kirill A. Shutemov wrote: >> On Sun, Apr 30, 2017 at 07:14:24PM -0400, Jerome Glisse wrote: >> > On Sat, Apr 29, 2017 at 01:17:26PM +0300, Kirill A. Shutemov wrote: >> > > On Fri, Apr 28, 2017 at

Re: [PATCH v2] mm, zone_device: replace {get, put}_zone_device_page() with a single reference

2017-05-01 Thread Jerome Glisse
On Mon, May 01, 2017 at 01:23:59PM +0300, Kirill A. Shutemov wrote: > On Sun, Apr 30, 2017 at 07:14:24PM -0400, Jerome Glisse wrote: > > On Sat, Apr 29, 2017 at 01:17:26PM +0300, Kirill A. Shutemov wrote: > > > On Fri, Apr 28, 2017 at 03:33:07PM -0400, Jerome Glisse wrote: > > > > On Fri, Apr 28,

Re: [PATCH v2] mm, zone_device: replace {get, put}_zone_device_page() with a single reference

2017-05-01 Thread Jerome Glisse
On Mon, May 01, 2017 at 01:23:59PM +0300, Kirill A. Shutemov wrote: > On Sun, Apr 30, 2017 at 07:14:24PM -0400, Jerome Glisse wrote: > > On Sat, Apr 29, 2017 at 01:17:26PM +0300, Kirill A. Shutemov wrote: > > > On Fri, Apr 28, 2017 at 03:33:07PM -0400, Jerome Glisse wrote: > > > > On Fri, Apr 28,

Re: [PATCH v2] mm, zone_device: replace {get, put}_zone_device_page() with a single reference

2017-05-01 Thread Kirill A. Shutemov
On Sun, Apr 30, 2017 at 07:14:24PM -0400, Jerome Glisse wrote: > On Sat, Apr 29, 2017 at 01:17:26PM +0300, Kirill A. Shutemov wrote: > > On Fri, Apr 28, 2017 at 03:33:07PM -0400, Jerome Glisse wrote: > > > On Fri, Apr 28, 2017 at 12:22:24PM -0700, Dan Williams wrote: > > > > Are you sure about

Re: [PATCH v2] mm, zone_device: replace {get, put}_zone_device_page() with a single reference

2017-05-01 Thread Kirill A. Shutemov
On Sun, Apr 30, 2017 at 07:14:24PM -0400, Jerome Glisse wrote: > On Sat, Apr 29, 2017 at 01:17:26PM +0300, Kirill A. Shutemov wrote: > > On Fri, Apr 28, 2017 at 03:33:07PM -0400, Jerome Glisse wrote: > > > On Fri, Apr 28, 2017 at 12:22:24PM -0700, Dan Williams wrote: > > > > Are you sure about

Re: [PATCH v2] mm, zone_device: replace {get, put}_zone_device_page() with a single reference

2017-05-01 Thread Kirill A. Shutemov
On Mon, May 01, 2017 at 09:12:59AM +0200, Ingo Molnar wrote: > ... is this extension to the changelog correct? Looks good to me. -- Kirill A. Shutemov

Re: [PATCH v2] mm, zone_device: replace {get, put}_zone_device_page() with a single reference

2017-05-01 Thread Kirill A. Shutemov
On Mon, May 01, 2017 at 09:12:59AM +0200, Ingo Molnar wrote: > ... is this extension to the changelog correct? Looks good to me. -- Kirill A. Shutemov

Re: [PATCH v2] mm, zone_device: replace {get, put}_zone_device_page() with a single reference

2017-05-01 Thread Ingo Molnar
* Dan Williams wrote: > On Sat, Apr 29, 2017 at 7:18 AM, Ingo Molnar wrote: > > > > * Dan Williams wrote: > > > >> Kirill points out that the calls to {get,put}_dev_pagemap() can be > >> removed from the mm fast path if we

Re: [PATCH v2] mm, zone_device: replace {get, put}_zone_device_page() with a single reference

2017-05-01 Thread Ingo Molnar
* Dan Williams wrote: > On Sat, Apr 29, 2017 at 7:18 AM, Ingo Molnar wrote: > > > > * Dan Williams wrote: > > > >> Kirill points out that the calls to {get,put}_dev_pagemap() can be > >> removed from the mm fast path if we take a single get_dev_pagemap() > >> reference to signify that the

Re: [PATCH v2] mm, zone_device: replace {get, put}_zone_device_page() with a single reference

2017-04-30 Thread Logan Gunthorpe
On 30/04/17 05:14 PM, Jerome Glisse wrote: > HMM ZONE_DEVICE pages are use like other pages (anonymous or file back page) > in _any_ vma. So i need to know when a page is freed ie either as result of > unmap, exit or migration or anything that would free the memory. For zone > device a page is

Re: [PATCH v2] mm, zone_device: replace {get, put}_zone_device_page() with a single reference

2017-04-30 Thread Logan Gunthorpe
On 30/04/17 05:14 PM, Jerome Glisse wrote: > HMM ZONE_DEVICE pages are use like other pages (anonymous or file back page) > in _any_ vma. So i need to know when a page is freed ie either as result of > unmap, exit or migration or anything that would free the memory. For zone > device a page is

Re: [PATCH v2] mm, zone_device: replace {get, put}_zone_device_page() with a single reference

2017-04-30 Thread Dan Williams
On Sat, Apr 29, 2017 at 7:18 AM, Ingo Molnar wrote: > > * Dan Williams wrote: > >> Kirill points out that the calls to {get,put}_dev_pagemap() can be >> removed from the mm fast path if we take a single get_dev_pagemap() >> reference to signify that

Re: [PATCH v2] mm, zone_device: replace {get, put}_zone_device_page() with a single reference

2017-04-30 Thread Dan Williams
On Sat, Apr 29, 2017 at 7:18 AM, Ingo Molnar wrote: > > * Dan Williams wrote: > >> Kirill points out that the calls to {get,put}_dev_pagemap() can be >> removed from the mm fast path if we take a single get_dev_pagemap() >> reference to signify that the page is alive and use the final put of the

Re: [PATCH v2] mm, zone_device: replace {get, put}_zone_device_page() with a single reference

2017-04-30 Thread Dan Williams
On Sun, Apr 30, 2017 at 6:54 PM, Jerome Glisse wrote: > On Sun, Apr 30, 2017 at 06:42:02PM -0700, Dan Williams wrote: >> On Sun, Apr 30, 2017 at 4:14 PM, Jerome Glisse wrote: >> > On Sat, Apr 29, 2017 at 01:17:26PM +0300, Kirill A. Shutemov wrote: >> >> On

Re: [PATCH v2] mm, zone_device: replace {get, put}_zone_device_page() with a single reference

2017-04-30 Thread Dan Williams
On Sun, Apr 30, 2017 at 6:54 PM, Jerome Glisse wrote: > On Sun, Apr 30, 2017 at 06:42:02PM -0700, Dan Williams wrote: >> On Sun, Apr 30, 2017 at 4:14 PM, Jerome Glisse wrote: >> > On Sat, Apr 29, 2017 at 01:17:26PM +0300, Kirill A. Shutemov wrote: >> >> On Fri, Apr 28, 2017 at 03:33:07PM -0400,

Re: [PATCH v2] mm, zone_device: replace {get, put}_zone_device_page() with a single reference

2017-04-30 Thread Jerome Glisse
On Sun, Apr 30, 2017 at 06:42:02PM -0700, Dan Williams wrote: > On Sun, Apr 30, 2017 at 4:14 PM, Jerome Glisse wrote: > > On Sat, Apr 29, 2017 at 01:17:26PM +0300, Kirill A. Shutemov wrote: > >> On Fri, Apr 28, 2017 at 03:33:07PM -0400, Jerome Glisse wrote: > >> > On Fri, Apr

Re: [PATCH v2] mm, zone_device: replace {get, put}_zone_device_page() with a single reference

2017-04-30 Thread Jerome Glisse
On Sun, Apr 30, 2017 at 06:42:02PM -0700, Dan Williams wrote: > On Sun, Apr 30, 2017 at 4:14 PM, Jerome Glisse wrote: > > On Sat, Apr 29, 2017 at 01:17:26PM +0300, Kirill A. Shutemov wrote: > >> On Fri, Apr 28, 2017 at 03:33:07PM -0400, Jerome Glisse wrote: > >> > On Fri, Apr 28, 2017 at

Re: [PATCH v2] mm, zone_device: replace {get, put}_zone_device_page() with a single reference

2017-04-30 Thread Dan Williams
On Sun, Apr 30, 2017 at 4:14 PM, Jerome Glisse wrote: > On Sat, Apr 29, 2017 at 01:17:26PM +0300, Kirill A. Shutemov wrote: >> On Fri, Apr 28, 2017 at 03:33:07PM -0400, Jerome Glisse wrote: >> > On Fri, Apr 28, 2017 at 12:22:24PM -0700, Dan Williams wrote: >> > > Are you sure

Re: [PATCH v2] mm, zone_device: replace {get, put}_zone_device_page() with a single reference

2017-04-30 Thread Dan Williams
On Sun, Apr 30, 2017 at 4:14 PM, Jerome Glisse wrote: > On Sat, Apr 29, 2017 at 01:17:26PM +0300, Kirill A. Shutemov wrote: >> On Fri, Apr 28, 2017 at 03:33:07PM -0400, Jerome Glisse wrote: >> > On Fri, Apr 28, 2017 at 12:22:24PM -0700, Dan Williams wrote: >> > > Are you sure about needing to

Re: [PATCH v2] mm, zone_device: replace {get, put}_zone_device_page() with a single reference

2017-04-30 Thread Jerome Glisse
On Sat, Apr 29, 2017 at 01:17:26PM +0300, Kirill A. Shutemov wrote: > On Fri, Apr 28, 2017 at 03:33:07PM -0400, Jerome Glisse wrote: > > On Fri, Apr 28, 2017 at 12:22:24PM -0700, Dan Williams wrote: > > > Are you sure about needing to hook the 2 -> 1 transition? Could we > > > change ZONE_DEVICE

Re: [PATCH v2] mm, zone_device: replace {get, put}_zone_device_page() with a single reference

2017-04-30 Thread Jerome Glisse
On Sat, Apr 29, 2017 at 01:17:26PM +0300, Kirill A. Shutemov wrote: > On Fri, Apr 28, 2017 at 03:33:07PM -0400, Jerome Glisse wrote: > > On Fri, Apr 28, 2017 at 12:22:24PM -0700, Dan Williams wrote: > > > Are you sure about needing to hook the 2 -> 1 transition? Could we > > > change ZONE_DEVICE

Re: [PATCH v2] mm, zone_device: replace {get, put}_zone_device_page() with a single reference

2017-04-29 Thread Ingo Molnar
* Dan Williams wrote: > Kirill points out that the calls to {get,put}_dev_pagemap() can be > removed from the mm fast path if we take a single get_dev_pagemap() > reference to signify that the page is alive and use the final put of the > page to drop that reference. >

Re: [PATCH v2] mm, zone_device: replace {get, put}_zone_device_page() with a single reference

2017-04-29 Thread Ingo Molnar
* Dan Williams wrote: > Kirill points out that the calls to {get,put}_dev_pagemap() can be > removed from the mm fast path if we take a single get_dev_pagemap() > reference to signify that the page is alive and use the final put of the > page to drop that reference. > > This does require some

Re: [PATCH v2] mm, zone_device: replace {get, put}_zone_device_page() with a single reference

2017-04-29 Thread Kirill A. Shutemov
On Fri, Apr 28, 2017 at 03:33:07PM -0400, Jerome Glisse wrote: > On Fri, Apr 28, 2017 at 12:22:24PM -0700, Dan Williams wrote: > > Are you sure about needing to hook the 2 -> 1 transition? Could we > > change ZONE_DEVICE pages to not have an elevated reference count when > > they are created so

Re: [PATCH v2] mm, zone_device: replace {get, put}_zone_device_page() with a single reference

2017-04-29 Thread Kirill A. Shutemov
On Fri, Apr 28, 2017 at 03:33:07PM -0400, Jerome Glisse wrote: > On Fri, Apr 28, 2017 at 12:22:24PM -0700, Dan Williams wrote: > > Are you sure about needing to hook the 2 -> 1 transition? Could we > > change ZONE_DEVICE pages to not have an elevated reference count when > > they are created so

Re: [PATCH v2] mm, zone_device: replace {get, put}_zone_device_page() with a single reference

2017-04-28 Thread Jerome Glisse
On Fri, Apr 28, 2017 at 12:22:24PM -0700, Dan Williams wrote: > On Fri, Apr 28, 2017 at 12:16 PM, Jerome Glisse wrote: > >> On Fri, Apr 28, 2017 at 11:00 AM, Jerome Glisse wrote: > >> >> On Fri, Apr 28, 2017 at 10:34 AM, Jerome Glisse

Re: [PATCH v2] mm, zone_device: replace {get, put}_zone_device_page() with a single reference

2017-04-28 Thread Jerome Glisse
On Fri, Apr 28, 2017 at 12:22:24PM -0700, Dan Williams wrote: > On Fri, Apr 28, 2017 at 12:16 PM, Jerome Glisse wrote: > >> On Fri, Apr 28, 2017 at 11:00 AM, Jerome Glisse wrote: > >> >> On Fri, Apr 28, 2017 at 10:34 AM, Jerome Glisse > >> >> wrote: > >> >> >> Kirill points out that the calls

Re: [PATCH v2] mm, zone_device: replace {get, put}_zone_device_page() with a single reference

2017-04-28 Thread Dan Williams
On Fri, Apr 28, 2017 at 12:16 PM, Jerome Glisse wrote: >> On Fri, Apr 28, 2017 at 11:00 AM, Jerome Glisse wrote: >> >> On Fri, Apr 28, 2017 at 10:34 AM, Jerome Glisse >> >> wrote: >> >> >> Kirill points out that the calls to

Re: [PATCH v2] mm, zone_device: replace {get, put}_zone_device_page() with a single reference

2017-04-28 Thread Dan Williams
On Fri, Apr 28, 2017 at 12:16 PM, Jerome Glisse wrote: >> On Fri, Apr 28, 2017 at 11:00 AM, Jerome Glisse wrote: >> >> On Fri, Apr 28, 2017 at 10:34 AM, Jerome Glisse >> >> wrote: >> >> >> Kirill points out that the calls to {get,put}_dev_pagemap() can be >> >> >> removed from the mm fast path

Re: [PATCH v2] mm, zone_device: replace {get, put}_zone_device_page() with a single reference

2017-04-28 Thread Jerome Glisse
> On Fri, Apr 28, 2017 at 11:00 AM, Jerome Glisse wrote: > >> On Fri, Apr 28, 2017 at 10:34 AM, Jerome Glisse > >> wrote: > >> >> Kirill points out that the calls to {get,put}_dev_pagemap() can be > >> >> removed from the mm fast path if we take a single

Re: [PATCH v2] mm, zone_device: replace {get, put}_zone_device_page() with a single reference

2017-04-28 Thread Jerome Glisse
> On Fri, Apr 28, 2017 at 11:00 AM, Jerome Glisse wrote: > >> On Fri, Apr 28, 2017 at 10:34 AM, Jerome Glisse > >> wrote: > >> >> Kirill points out that the calls to {get,put}_dev_pagemap() can be > >> >> removed from the mm fast path if we take a single get_dev_pagemap() > >> >> reference to

Re: [PATCH v2] mm, zone_device: replace {get, put}_zone_device_page() with a single reference

2017-04-28 Thread Dan Williams
On Fri, Apr 28, 2017 at 11:00 AM, Jerome Glisse wrote: >> On Fri, Apr 28, 2017 at 10:34 AM, Jerome Glisse wrote: >> >> Kirill points out that the calls to {get,put}_dev_pagemap() can be >> >> removed from the mm fast path if we take a single

Re: [PATCH v2] mm, zone_device: replace {get, put}_zone_device_page() with a single reference

2017-04-28 Thread Dan Williams
On Fri, Apr 28, 2017 at 11:00 AM, Jerome Glisse wrote: >> On Fri, Apr 28, 2017 at 10:34 AM, Jerome Glisse wrote: >> >> Kirill points out that the calls to {get,put}_dev_pagemap() can be >> >> removed from the mm fast path if we take a single get_dev_pagemap() >> >> reference to signify that the

Re: [PATCH v2] mm, zone_device: replace {get, put}_zone_device_page() with a single reference

2017-04-28 Thread Jerome Glisse
> On Fri, Apr 28, 2017 at 10:34 AM, Jerome Glisse wrote: > >> Kirill points out that the calls to {get,put}_dev_pagemap() can be > >> removed from the mm fast path if we take a single get_dev_pagemap() > >> reference to signify that the page is alive and use the final put of

Re: [PATCH v2] mm, zone_device: replace {get, put}_zone_device_page() with a single reference

2017-04-28 Thread Jerome Glisse
> On Fri, Apr 28, 2017 at 10:34 AM, Jerome Glisse wrote: > >> Kirill points out that the calls to {get,put}_dev_pagemap() can be > >> removed from the mm fast path if we take a single get_dev_pagemap() > >> reference to signify that the page is alive and use the final put of the > >> page to drop

Re: [PATCH v2] mm, zone_device: replace {get, put}_zone_device_page() with a single reference

2017-04-28 Thread Dan Williams
On Fri, Apr 28, 2017 at 10:34 AM, Jerome Glisse wrote: >> Kirill points out that the calls to {get,put}_dev_pagemap() can be >> removed from the mm fast path if we take a single get_dev_pagemap() >> reference to signify that the page is alive and use the final put of the >>

Re: [PATCH v2] mm, zone_device: replace {get, put}_zone_device_page() with a single reference

2017-04-28 Thread Dan Williams
On Fri, Apr 28, 2017 at 10:34 AM, Jerome Glisse wrote: >> Kirill points out that the calls to {get,put}_dev_pagemap() can be >> removed from the mm fast path if we take a single get_dev_pagemap() >> reference to signify that the page is alive and use the final put of the >> page to drop that

Re: [PATCH v2] mm, zone_device: replace {get, put}_zone_device_page() with a single reference

2017-04-28 Thread Jerome Glisse
> Kirill points out that the calls to {get,put}_dev_pagemap() can be > removed from the mm fast path if we take a single get_dev_pagemap() > reference to signify that the page is alive and use the final put of the > page to drop that reference. > > This does require some care to make sure that

Re: [PATCH v2] mm, zone_device: replace {get, put}_zone_device_page() with a single reference

2017-04-28 Thread Jerome Glisse
> Kirill points out that the calls to {get,put}_dev_pagemap() can be > removed from the mm fast path if we take a single get_dev_pagemap() > reference to signify that the page is alive and use the final put of the > page to drop that reference. > > This does require some care to make sure that

[PATCH v2] mm, zone_device: replace {get, put}_zone_device_page() with a single reference

2017-04-28 Thread Dan Williams
Kirill points out that the calls to {get,put}_dev_pagemap() can be removed from the mm fast path if we take a single get_dev_pagemap() reference to signify that the page is alive and use the final put of the page to drop that reference. This does require some care to make sure that any waits for

[PATCH v2] mm, zone_device: replace {get, put}_zone_device_page() with a single reference

2017-04-28 Thread Dan Williams
Kirill points out that the calls to {get,put}_dev_pagemap() can be removed from the mm fast path if we take a single get_dev_pagemap() reference to signify that the page is alive and use the final put of the page to drop that reference. This does require some care to make sure that any waits for