Re: [PATCH 3/4] mm/gup: add a range variant of unpin_user_pages_dirty_lock()

2021-02-04 Thread Joao Martins
On 2/4/21 11:35 AM, Joao Martins wrote: > On 2/3/21 11:37 PM, John Hubbard wrote: >> On 2/3/21 2:00 PM, Joao Martins wrote: >>> -static inline unsigned int count_ntails(struct page **pages, unsigned long >>> npages) >>> +static inline unsigned int count_ntails(struct page **pages, >>> +

Re: [PATCH 3/4] mm/gup: add a range variant of unpin_user_pages_dirty_lock()

2021-02-04 Thread Joao Martins
On 2/4/21 12:11 AM, John Hubbard wrote: > On 2/3/21 2:00 PM, Joao Martins wrote: > ... >> +void unpin_user_page_range_dirty_lock(struct page *page, unsigned long >> npages, >> + bool make_dirty) >> +{ >> +unsigned long index; >> +struct page *head; >> +

Re: [PATCH 3/4] mm/gup: add a range variant of unpin_user_pages_dirty_lock()

2021-02-04 Thread Joao Martins
On 2/3/21 11:37 PM, John Hubbard wrote: > On 2/3/21 2:00 PM, Joao Martins wrote: >> Add a unpin_user_page_range() API which takes a starting page >> and how many consecutive pages we want to dirty. >> >> Given that we won't be iterating on a list of changes, change >> compound_next() to receive

Re: [PATCH 3/4] mm/gup: add a range variant of unpin_user_pages_dirty_lock()

2021-02-03 Thread John Hubbard
On 2/3/21 2:00 PM, Joao Martins wrote: ... +void unpin_user_page_range_dirty_lock(struct page *page, unsigned long npages, + bool make_dirty) +{ + unsigned long index; + struct page *head; + unsigned int ntails; + +

Re: [PATCH 3/4] mm/gup: add a range variant of unpin_user_pages_dirty_lock()

2021-02-03 Thread John Hubbard
On 2/3/21 2:00 PM, Joao Martins wrote: Add a unpin_user_page_range() API which takes a starting page and how many consecutive pages we want to dirty. Given that we won't be iterating on a list of changes, change compound_next() to receive a bool, whether to calculate from the starting page, or

[PATCH 3/4] mm/gup: add a range variant of unpin_user_pages_dirty_lock()

2021-02-03 Thread Joao Martins
Add a unpin_user_page_range() API which takes a starting page and how many consecutive pages we want to dirty. Given that we won't be iterating on a list of changes, change compound_next() to receive a bool, whether to calculate from the starting page, or walk the page array. Finally add a