mm: numa: avoid unnecessary work on the failure path
authorMel Gorman <[email protected]>
Thu, 19 Dec 2013 01:08:39 +0000 (17:08 -0800)
committerLinus Torvalds <[email protected]>
Thu, 19 Dec 2013 03:04:51 +0000 (19:04 -0800)
If a PMD changes during a THP migration then migration aborts but the
failure path is doing more work than is necessary.

Signed-off-by: Mel Gorman <[email protected]>
Reviewed-by: Rik van Riel <[email protected]>
Cc: Alex Thorlton <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/migrate.c

index be787d506fbbf3347da5b2a4f8e984b9f0450f18..a987525810ae3da6aec4b358944b33da80d33366 100644 (file)
@@ -1780,7 +1780,8 @@ fail_putback:
                putback_lru_page(page);
                mod_zone_page_state(page_zone(page),
                         NR_ISOLATED_ANON + page_lru, -HPAGE_PMD_NR);
-               goto out_fail;
+
+               goto out_unlock;
        }
 
        /*
@@ -1854,6 +1855,7 @@ out_dropref:
        }
        spin_unlock(ptl);
 
+out_unlock:
        unlock_page(page);
        put_page(page);
        return 0;