Re: [PATCH RFC 7/9] mm/gup: Decrement head page once for group of subpages

2020-12-19 Thread Joao Martins
On 12/19/20 2:06 AM, John Hubbard wrote: > On 12/17/20 12:05 PM, Jason Gunthorpe wrote: >> On Thu, Dec 17, 2020 at 07:05:37PM +, Joao Martins wrote: No reason not to fix set_page_dirty_lock() too while you are here. >>> >>> The wack of atomics you mentioned earlier you referred to, I suppo

Re: [PATCH RFC 7/9] mm/gup: Decrement head page once for group of subpages

2020-12-18 Thread John Hubbard
On 12/17/20 12:05 PM, Jason Gunthorpe wrote: On Thu, Dec 17, 2020 at 07:05:37PM +, Joao Martins wrote: No reason not to fix set_page_dirty_lock() too while you are here. The wack of atomics you mentioned earlier you referred to, I suppose it ends being account_page_dirtied(). See partial d

Re: [PATCH RFC 7/9] mm/gup: Decrement head page once for group of subpages

2020-12-17 Thread Joao Martins
On 12/17/20 8:05 PM, Jason Gunthorpe wrote: > On Thu, Dec 17, 2020 at 07:05:37PM +, Joao Martins wrote: >>> No reason not to fix set_page_dirty_lock() too while you are here. >> >> The wack of atomics you mentioned earlier you referred to, I suppose it >> ends being account_page_dirtied(). See

Re: [PATCH RFC 7/9] mm/gup: Decrement head page once for group of subpages

2020-12-17 Thread Joao Martins
On 12/8/20 7:34 PM, Jason Gunthorpe wrote: >> @@ -274,6 +291,7 @@ void unpin_user_pages_dirty_lock(struct page **pages, >> unsigned long npages, >> bool make_dirty) >> { >> unsigned long index; >> +int refs = 1; >> >> /* >> * TODO: this can be o

Re: [PATCH RFC 7/9] mm/gup: Decrement head page once for group of subpages

2020-12-09 Thread Joao Martins
On 12/8/20 7:34 PM, Jason Gunthorpe wrote: > On Tue, Dec 08, 2020 at 05:28:59PM +, Joao Martins wrote: >> Rather than decrementing the ref count one by one, we >> walk the page array and checking which belong to the same >> compound_head. Later on we decrement the calculated amount >> of refere

Re: [PATCH RFC 7/9] mm/gup: Decrement head page once for group of subpages

2020-12-08 Thread John Hubbard
On 12/8/20 11:34 AM, Jason Gunthorpe wrote: On Tue, Dec 08, 2020 at 05:28:59PM +, Joao Martins wrote: Rather than decrementing the ref count one by one, we walk the page array and checking which belong to the same compound_head. Later on we decrement the calculated amount of references in a

[PATCH RFC 7/9] mm/gup: Decrement head page once for group of subpages

2020-12-08 Thread Joao Martins
Rather than decrementing the ref count one by one, we walk the page array and checking which belong to the same compound_head. Later on we decrement the calculated amount of references in a single write to the head page. Signed-off-by: Joao Martins --- mm/gup.c | 41 +