Re: [PATCH v2 5/6] mm: track gup pages with page->dma_pinned_* fields

2018-07-09 Thread Jan Kara
On Thu 05-07-18 14:17:19, Christopher Lameter wrote: > On Wed, 4 Jul 2018, Jan Kara wrote: > > > > So this seems unsolvable without having the caller specify that it knows > > > the > > > page type, and that it is therefore safe to decrement > > > page->dma_pinned_count. > > > I was hoping I'd

Re: [PATCH v2 5/6] mm: track gup pages with page->dma_pinned_* fields

2018-07-09 Thread Jan Kara
On Thu 05-07-18 14:17:19, Christopher Lameter wrote: > On Wed, 4 Jul 2018, Jan Kara wrote: > > > > So this seems unsolvable without having the caller specify that it knows > > > the > > > page type, and that it is therefore safe to decrement > > > page->dma_pinned_count. > > > I was hoping I'd

Re: [PATCH v2 5/6] mm: track gup pages with page->dma_pinned_* fields

2018-07-05 Thread Christopher Lameter
On Wed, 4 Jul 2018, Jan Kara wrote: > > So this seems unsolvable without having the caller specify that it knows the > > page type, and that it is therefore safe to decrement > > page->dma_pinned_count. > > I was hoping I'd found a way, but clearly I haven't. :) > > Well, I think the

Re: [PATCH v2 5/6] mm: track gup pages with page->dma_pinned_* fields

2018-07-05 Thread Christopher Lameter
On Wed, 4 Jul 2018, Jan Kara wrote: > > So this seems unsolvable without having the caller specify that it knows the > > page type, and that it is therefore safe to decrement > > page->dma_pinned_count. > > I was hoping I'd found a way, but clearly I haven't. :) > > Well, I think the

Re: [PATCH v2 5/6] mm: track gup pages with page->dma_pinned_* fields

2018-07-04 Thread Jan Kara
On Tue 03-07-18 10:36:05, John Hubbard wrote: > On 07/03/2018 10:08 AM, Christopher Lameter wrote: > > On Mon, 2 Jul 2018, John Hubbard wrote: > > > >>> If you establish a reference to a page then increase the page count. If > >>> the reference is a dma pin action also then increase the pinned

Re: [PATCH v2 5/6] mm: track gup pages with page->dma_pinned_* fields

2018-07-04 Thread Jan Kara
On Tue 03-07-18 10:36:05, John Hubbard wrote: > On 07/03/2018 10:08 AM, Christopher Lameter wrote: > > On Mon, 2 Jul 2018, John Hubbard wrote: > > > >>> If you establish a reference to a page then increase the page count. If > >>> the reference is a dma pin action also then increase the pinned

Re: [PATCH v2 5/6] mm: track gup pages with page->dma_pinned_* fields

2018-07-03 Thread John Hubbard
On 07/03/2018 10:48 AM, Christopher Lameter wrote: > On Tue, 3 Jul 2018, John Hubbard wrote: > >> The page->_refcount field is used normally, in addition to the >> dma_pinned_count. >> But the problem is that, unless the caller knows what kind of page it is, >> the page->dma_pinned_count cannot

Re: [PATCH v2 5/6] mm: track gup pages with page->dma_pinned_* fields

2018-07-03 Thread John Hubbard
On 07/03/2018 10:48 AM, Christopher Lameter wrote: > On Tue, 3 Jul 2018, John Hubbard wrote: > >> The page->_refcount field is used normally, in addition to the >> dma_pinned_count. >> But the problem is that, unless the caller knows what kind of page it is, >> the page->dma_pinned_count cannot

Re: [PATCH v2 5/6] mm: track gup pages with page->dma_pinned_* fields

2018-07-03 Thread Christopher Lameter
On Tue, 3 Jul 2018, John Hubbard wrote: > The page->_refcount field is used normally, in addition to the > dma_pinned_count. > But the problem is that, unless the caller knows what kind of page it is, > the page->dma_pinned_count cannot be looked at, because it is unioned with > page->lru.prev.

Re: [PATCH v2 5/6] mm: track gup pages with page->dma_pinned_* fields

2018-07-03 Thread Christopher Lameter
On Tue, 3 Jul 2018, John Hubbard wrote: > The page->_refcount field is used normally, in addition to the > dma_pinned_count. > But the problem is that, unless the caller knows what kind of page it is, > the page->dma_pinned_count cannot be looked at, because it is unioned with > page->lru.prev.

Re: [PATCH v2 5/6] mm: track gup pages with page->dma_pinned_* fields

2018-07-03 Thread John Hubbard
On 07/03/2018 10:08 AM, Christopher Lameter wrote: > On Mon, 2 Jul 2018, John Hubbard wrote: > >>> If you establish a reference to a page then increase the page count. If >>> the reference is a dma pin action also then increase the pinned count. >>> >>> That way you know how many of the

Re: [PATCH v2 5/6] mm: track gup pages with page->dma_pinned_* fields

2018-07-03 Thread John Hubbard
On 07/03/2018 10:08 AM, Christopher Lameter wrote: > On Mon, 2 Jul 2018, John Hubbard wrote: > >>> If you establish a reference to a page then increase the page count. If >>> the reference is a dma pin action also then increase the pinned count. >>> >>> That way you know how many of the

Re: [PATCH v2 5/6] mm: track gup pages with page->dma_pinned_* fields

2018-07-03 Thread Christopher Lameter
On Mon, 2 Jul 2018, John Hubbard wrote: > > If you establish a reference to a page then increase the page count. If > > the reference is a dma pin action also then increase the pinned count. > > > > That way you know how many of the references to the page are dma > > pins and you can correctly

Re: [PATCH v2 5/6] mm: track gup pages with page->dma_pinned_* fields

2018-07-03 Thread Christopher Lameter
On Mon, 2 Jul 2018, John Hubbard wrote: > > If you establish a reference to a page then increase the page count. If > > the reference is a dma pin action also then increase the pinned count. > > > > That way you know how many of the references to the page are dma > > pins and you can correctly

Re: [PATCH v2 5/6] mm: track gup pages with page->dma_pinned_* fields

2018-07-02 Thread John Hubbard
On 07/02/2018 05:08 PM, Christopher Lameter wrote: > On Mon, 2 Jul 2018, John Hubbard wrote: > >>> >>> These two are just wrong. You cannot make any page reference for >>> PageDmaPinned() account against a pin count. First, it is just conceptually >>> wrong as these references need not be long

Re: [PATCH v2 5/6] mm: track gup pages with page->dma_pinned_* fields

2018-07-02 Thread John Hubbard
On 07/02/2018 05:08 PM, Christopher Lameter wrote: > On Mon, 2 Jul 2018, John Hubbard wrote: > >>> >>> These two are just wrong. You cannot make any page reference for >>> PageDmaPinned() account against a pin count. First, it is just conceptually >>> wrong as these references need not be long

Re: [PATCH v2 5/6] mm: track gup pages with page->dma_pinned_* fields

2018-07-02 Thread Christopher Lameter
On Mon, 2 Jul 2018, John Hubbard wrote: > > > > These two are just wrong. You cannot make any page reference for > > PageDmaPinned() account against a pin count. First, it is just conceptually > > wrong as these references need not be long term pins, second, you can > > easily race like: > > > >

Re: [PATCH v2 5/6] mm: track gup pages with page->dma_pinned_* fields

2018-07-02 Thread Christopher Lameter
On Mon, 2 Jul 2018, John Hubbard wrote: > > > > These two are just wrong. You cannot make any page reference for > > PageDmaPinned() account against a pin count. First, it is just conceptually > > wrong as these references need not be long term pins, second, you can > > easily race like: > > > >

Re: [PATCH v2 5/6] mm: track gup pages with page->dma_pinned_* fields

2018-07-02 Thread John Hubbard
On 07/02/2018 02:53 AM, Jan Kara wrote: > On Sun 01-07-18 17:56:53, john.hubb...@gmail.com wrote: >> From: John Hubbard >> > ... > >> @@ -904,12 +907,24 @@ static inline void get_page(struct page *page) >> */ >> VM_BUG_ON_PAGE(page_ref_count(page) <= 0, page); >>

Re: [PATCH v2 5/6] mm: track gup pages with page->dma_pinned_* fields

2018-07-02 Thread John Hubbard
On 07/02/2018 02:53 AM, Jan Kara wrote: > On Sun 01-07-18 17:56:53, john.hubb...@gmail.com wrote: >> From: John Hubbard >> > ... > >> @@ -904,12 +907,24 @@ static inline void get_page(struct page *page) >> */ >> VM_BUG_ON_PAGE(page_ref_count(page) <= 0, page); >>

Re: [PATCH v2 5/6] mm: track gup pages with page->dma_pinned_* fields

2018-07-02 Thread Jan Kara
On Sun 01-07-18 17:56:53, john.hubb...@gmail.com wrote: > From: John Hubbard > > This patch sets and restores the new page->dma_pinned_flags and > page->dma_pinned_count fields, but does not actually use them for > anything yet. > > In order to use these fields at all, the page must be removed

Re: [PATCH v2 5/6] mm: track gup pages with page->dma_pinned_* fields

2018-07-02 Thread Jan Kara
On Sun 01-07-18 17:56:53, john.hubb...@gmail.com wrote: > From: John Hubbard > > This patch sets and restores the new page->dma_pinned_flags and > page->dma_pinned_count fields, but does not actually use them for > anything yet. > > In order to use these fields at all, the page must be removed

Re: [PATCH v2 5/6] mm: track gup pages with page->dma_pinned_* fields

2018-07-01 Thread John Hubbard
On 07/01/2018 07:58 PM, kbuild test robot wrote: > Hi John, > > Thank you for the patch! Perhaps something to improve: > > [auto build test WARNING on linus/master] > [also build test WARNING on v4.18-rc3] > [cannot apply to next-20180629] > [if your patch is applied to the wrong git tree,

Re: [PATCH v2 5/6] mm: track gup pages with page->dma_pinned_* fields

2018-07-01 Thread John Hubbard
On 07/01/2018 07:58 PM, kbuild test robot wrote: > Hi John, > > Thank you for the patch! Perhaps something to improve: > > [auto build test WARNING on linus/master] > [also build test WARNING on v4.18-rc3] > [cannot apply to next-20180629] > [if your patch is applied to the wrong git tree,

Re: [PATCH v2 5/6] mm: track gup pages with page->dma_pinned_* fields

2018-07-01 Thread kbuild test robot
Hi John, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on linus/master] [also build test WARNING on v4.18-rc3] [cannot apply to next-20180629] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url:

Re: [PATCH v2 5/6] mm: track gup pages with page->dma_pinned_* fields

2018-07-01 Thread kbuild test robot
Hi John, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on linus/master] [also build test WARNING on v4.18-rc3] [cannot apply to next-20180629] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url:

Re: [PATCH v2 5/6] mm: track gup pages with page->dma_pinned_* fields

2018-07-01 Thread kbuild test robot
Hi John, Thank you for the patch! Yet something to improve: [auto build test ERROR on linus/master] [also build test ERROR on v4.18-rc3] [cannot apply to next-20180629] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url:

Re: [PATCH v2 5/6] mm: track gup pages with page->dma_pinned_* fields

2018-07-01 Thread kbuild test robot
Hi John, Thank you for the patch! Yet something to improve: [auto build test ERROR on linus/master] [also build test ERROR on v4.18-rc3] [cannot apply to next-20180629] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url:

[PATCH v2 5/6] mm: track gup pages with page->dma_pinned_* fields

2018-07-01 Thread john . hubbard
From: John Hubbard This patch sets and restores the new page->dma_pinned_flags and page->dma_pinned_count fields, but does not actually use them for anything yet. In order to use these fields at all, the page must be removed from any LRU list that it's on. The patch also adds some precautions

[PATCH v2 5/6] mm: track gup pages with page->dma_pinned_* fields

2018-07-01 Thread john . hubbard
From: John Hubbard This patch sets and restores the new page->dma_pinned_flags and page->dma_pinned_count fields, but does not actually use them for anything yet. In order to use these fields at all, the page must be removed from any LRU list that it's on. The patch also adds some precautions