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

2019-06-26 Thread Pingfan Liu
On Thu, Jun 27, 2019 at 7:15 AM Andrew Morton wrote: > > On Wed, 26 Jun 2019 21:10:00 +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: [PATCHv4] mm/gup: speed up check_and_migrate_cma_pages() on huge page

2019-06-26 Thread Andrew Morton
On Wed, 26 Jun 2019 21:10:00 +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. By thi

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

2019-06-26 Thread Ira Weiny
On Wed, Jun 26, 2019 at 09:10:00PM +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

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

2019-06-26 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