Re: [PATCH v8 02/14] mm/gup: check every subpage of a compound page during isolation

2021-02-03 Thread Jason Gunthorpe
On Wed, Feb 03, 2021 at 04:13:21PM +, Joao Martins wrote: > If check_and_migrate_movable_pages() is meant to migrate unpinned > pages, then rather than pinning+unpinning+moving, perhaps it would > be called in __get_user_pages() place where we are walking page > tables and know if it's a PUD/P

Re: [PATCH v8 02/14] mm/gup: check every subpage of a compound page during isolation

2021-02-03 Thread Joao Martins
On 2/3/21 3:32 PM, Joao Martins wrote: > On 2/3/21 2:51 PM, Pavel Tatashin wrote: >> On Wed, Feb 3, 2021 at 8:23 AM Joao Martins >> wrote: >>> On 1/25/21 7:47 PM, Pavel Tatashin wrote: >>> for compound pages but when !is_transparent_hugepage(head) or just >>> PageHuge(head) like: >>> >>> +

Re: [PATCH v8 02/14] mm/gup: check every subpage of a compound page during isolation

2021-02-03 Thread Joao Martins
On 2/3/21 2:53 PM, Jason Gunthorpe wrote: > On Wed, Feb 03, 2021 at 01:22:18PM +, Joao Martins wrote: > >> With this, longterm gup will 'regress' for hugetlbfs e.g. from ~6k -> ~32k >> usecs when >> pinning a 16G hugetlb file. > > Yes, but correctness demands it. > Hence the quotes around t

Re: [PATCH v8 02/14] mm/gup: check every subpage of a compound page during isolation

2021-02-03 Thread Joao Martins
On 2/3/21 2:51 PM, Pavel Tatashin wrote: > On Wed, Feb 3, 2021 at 8:23 AM Joao Martins wrote: >> >> On 1/25/21 7:47 PM, Pavel Tatashin wrote: >>> When pages are isolated in check_and_migrate_movable_pages() we skip >>> compound number of pages at a time. However, as Jason noted, it is >>> not nece

Re: [PATCH v8 02/14] mm/gup: check every subpage of a compound page during isolation

2021-02-03 Thread Jason Gunthorpe
On Wed, Feb 03, 2021 at 01:22:18PM +, Joao Martins wrote: > With this, longterm gup will 'regress' for hugetlbfs e.g. from ~6k -> 32k > usecs when > pinning a 16G hugetlb file. Yes, but correctness demands it. The solution is to track these pages as we discover them so we know if a PMD/PUD

Re: [PATCH v8 02/14] mm/gup: check every subpage of a compound page during isolation

2021-02-03 Thread Pavel Tatashin
On Wed, Feb 3, 2021 at 8:23 AM Joao Martins wrote: > > On 1/25/21 7:47 PM, Pavel Tatashin wrote: > > When pages are isolated in check_and_migrate_movable_pages() we skip > > compound number of pages at a time. However, as Jason noted, it is > > not necessary correct that pages[i] corresponds to th

Re: [PATCH v8 02/14] mm/gup: check every subpage of a compound page during isolation

2021-02-03 Thread Joao Martins
On 1/25/21 7:47 PM, Pavel Tatashin wrote: > When pages are isolated in check_and_migrate_movable_pages() we skip > compound number of pages at a time. However, as Jason noted, it is > not necessary correct that pages[i] corresponds to the pages that > we skipped. This is because it is possible that

[PATCH v8 02/14] mm/gup: check every subpage of a compound page during isolation

2021-01-25 Thread Pavel Tatashin
When pages are isolated in check_and_migrate_movable_pages() we skip compound number of pages at a time. However, as Jason noted, it is not necessary correct that pages[i] corresponds to the pages that we skipped. This is because it is possible that the addresses in this range had split_huge_pmd()/