Re: [PATCHv3] mm/gup: speed up check_and_migrate_cma_pages() on huge page

2019-06-26 Thread Pingfan Liu
On Wed, Jun 26, 2019 at 1:51 AM Ira Weiny wrote: > > On Tue, Jun 25, 2019 at 10:13:19PM +0800, Pingfan Liu wrote: > > Both hugetlb and thp locate on the same migration type of pageblock, since > > they are allocated from a free_list[]. Based on this fact, it is enough to > > check on a single subp

Re: [PATCHv3] mm/gup: speed up check_and_migrate_cma_pages() on huge page

2019-06-25 Thread Ira Weiny
On Tue, Jun 25, 2019 at 10:13:19PM +0800, Pingfan Liu wrote: > Both hugetlb and thp locate on the same migration type of pageblock, since > they are allocated from a free_list[]. Based on this fact, it is enough to > check on a single subpage to decide the migration type of the whole huge > page. B

[PATCHv3] mm/gup: speed up check_and_migrate_cma_pages() on huge page

2019-06-25 Thread Pingfan Liu
Both hugetlb and thp locate on the same migration type of pageblock, since they are allocated from a free_list[]. Based on this fact, it is enough to check on a single subpage to decide the migration type of the whole huge page. By this way, it saves (2M/4K - 1) times loop for pmd_huge on x86, simi