Re: [PATCH v2 1/4] mm/gup: add compound page list iterator

2021-02-05 Thread John Hubbard
On 2/5/21 2:46 AM, Joao Martins wrote: ...>> If instead you keep npages constant like it naturally wants to be, you could just do a "(*ntails)++" in the loop, to take care of *ntails. I didn't do it as such as I would need to deref @ntails per iteration, so it felt more efficient to do as

Re: [PATCH v2 1/4] mm/gup: add compound page list iterator

2021-02-05 Thread Joao Martins
On 2/5/21 4:11 AM, John Hubbard wrote: > On 2/4/21 12:24 PM, Joao Martins wrote: >> Add an helper that iterates over head pages in a list of pages. It >> essentially counts the tails until the next page to process has a >> different head that the current. This is going to be used by >>

Re: [PATCH v2 1/4] mm/gup: add compound page list iterator

2021-02-04 Thread John Hubbard
On 2/4/21 12:24 PM, Joao Martins wrote: Add an helper that iterates over head pages in a list of pages. It essentially counts the tails until the next page to process has a different head that the current. This is going to be used by unpin_user_pages() family of functions, to batch the head page

[PATCH v2 1/4] mm/gup: add compound page list iterator

2021-02-04 Thread Joao Martins
Add an helper that iterates over head pages in a list of pages. It essentially counts the tails until the next page to process has a different head that the current. This is going to be used by unpin_user_pages() family of functions, to batch the head page refcount updates once for all passed