Comment 12 for bug 1680390

Revision history for this message
bugproxy (bugproxy) wrote : Comment bridged from LTC Bugzilla

------- Comment From <email address hidden> 2017-09-18 15:39 EDT-------
>
> However 6e2a092a48d3 does contain some changes that seem unrelated to the
> new interface, could you please advise whether or not these need to be
> reapplied?
>
> diff --git a/mm/huge_memory.c b/mm/huge_memory.c
> index 85742ac5b32e..a7bac4f2b78a 100644
> --- a/mm/huge_memory.c
> +++ b/mm/huge_memory.c
> @@ -2129,9 +2129,12 @@ static void freeze_page(struct page *page)
> static void unfreeze_page(struct page *page)
> {
> int i;
> -
> - for (i = 0; i < HPAGE_PMD_NR; i++)
> - remove_migration_ptes(page + i, page + i, true);
> + if (PageTransHuge(page)) {
> + remove_migration_ptes(page, page, true);
> + } else {
> + for (i = 0; i < HPAGE_PMD_NR; i++)
> + remove_migration_ptes(page + i, page + i, true);
> + }
> }
>
> static void __split_huge_page_tail(struct page *head, int tail,

the above change should have been applied independently of all the other changes in 6e2a092a48d3.
The change avoids calling remove_migration_ptes() on all sub pages, when it knows that only the head page needs to removed from migration. With or without the change the code works. However, it saves some cycles, with the change.