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

2019-06-27 Thread Pingfan Liu
On Fri, Jun 28, 2019 at 7:25 AM Andrew Morton wrote: > > On Thu, 27 Jun 2019 13:15:45 +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

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

2019-06-27 Thread Ira Weiny
On Thu, Jun 27, 2019 at 01:15:45PM +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.

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

2019-06-27 Thread Andrew Morton
On Thu, 27 Jun 2019 13:15:45 +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

[PATCHv5] 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,