summaryrefslogtreecommitdiffstats
path: root/mm/compaction.c
diff options
context:
space:
mode:
authorVlastimil Babka <vbabka@suse.cz>2016-10-07 19:57:38 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-10-07 21:46:27 -0400
commit791cae9620e35d18df2cedf2bd444920c3ecf04a (patch)
treefc234a178d73f3e70ff4598cc35041ab494158db /mm/compaction.c
parent06ed29989f39f5129d4f76f4a2d7ce2efa46a6a1 (diff)
mm, compaction: cleanup unused functions
Since kswapd compaction moved to kcompactd, compact_pgdat() is not called anymore, so we remove it. The only caller of __compact_pgdat() is compact_node(), so we merge them and remove code that was only reachable from kswapd. Link: http://lkml.kernel.org/r/20160810091226.6709-3-vbabka@suse.cz Signed-off-by: Vlastimil Babka <vbabka@suse.cz> Tested-by: Lorenzo Stoakes <lstoakes@gmail.com> Acked-by: Michal Hocko <mhocko@suse.com> Cc: Mel Gorman <mgorman@techsingularity.net> Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com> Cc: David Rientjes <rientjes@google.com> Cc: Rik van Riel <riel@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/compaction.c')
-rw-r--r--mm/compaction.c60
1 files changed, 17 insertions, 43 deletions
diff --git a/mm/compaction.c b/mm/compaction.c
index c684ca141e4b..8e32778fba5b 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -1736,10 +1736,18 @@ enum compact_result try_to_compact_pages(gfp_t gfp_mask, unsigned int order,
1736 1736
1737 1737
1738/* Compact all zones within a node */ 1738/* Compact all zones within a node */
1739static void __compact_pgdat(pg_data_t *pgdat, struct compact_control *cc) 1739static void compact_node(int nid)
1740{ 1740{
1741 pg_data_t *pgdat = NODE_DATA(nid);
1741 int zoneid; 1742 int zoneid;
1742 struct zone *zone; 1743 struct zone *zone;
1744 struct compact_control cc = {
1745 .order = -1,
1746 .mode = MIGRATE_SYNC,
1747 .ignore_skip_hint = true,
1748 .whole_zone = true,
1749 };
1750
1743 1751
1744 for (zoneid = 0; zoneid < MAX_NR_ZONES; zoneid++) { 1752 for (zoneid = 0; zoneid < MAX_NR_ZONES; zoneid++) {
1745 1753
@@ -1747,53 +1755,19 @@ static void __compact_pgdat(pg_data_t *pgdat, struct compact_control *cc)
1747 if (!populated_zone(zone)) 1755 if (!populated_zone(zone))
1748 continue; 1756 continue;
1749 1757
1750 cc->nr_freepages = 0; 1758 cc.nr_freepages = 0;
1751 cc->nr_migratepages = 0; 1759 cc.nr_migratepages = 0;
1752 cc->zone = zone; 1760 cc.zone = zone;
1753 INIT_LIST_HEAD(&cc->freepages); 1761 INIT_LIST_HEAD(&cc.freepages);
1754 INIT_LIST_HEAD(&cc->migratepages); 1762 INIT_LIST_HEAD(&cc.migratepages);
1755
1756 if (is_via_compact_memory(cc->order) ||
1757 !compaction_deferred(zone, cc->order))
1758 compact_zone(zone, cc);
1759
1760 VM_BUG_ON(!list_empty(&cc->freepages));
1761 VM_BUG_ON(!list_empty(&cc->migratepages));
1762 1763
1763 if (is_via_compact_memory(cc->order)) 1764 compact_zone(zone, &cc);
1764 continue;
1765 1765
1766 if (zone_watermark_ok(zone, cc->order, 1766 VM_BUG_ON(!list_empty(&cc.freepages));
1767 low_wmark_pages(zone), 0, 0)) 1767 VM_BUG_ON(!list_empty(&cc.migratepages));
1768 compaction_defer_reset(zone, cc->order, false);
1769 } 1768 }
1770} 1769}
1771 1770
1772void compact_pgdat(pg_data_t *pgdat, int order)
1773{
1774 struct compact_control cc = {
1775 .order = order,
1776 .mode = MIGRATE_ASYNC,
1777 };
1778
1779 if (!order)
1780 return;
1781
1782 __compact_pgdat(pgdat, &cc);
1783}
1784
1785static void compact_node(int nid)
1786{
1787 struct compact_control cc = {
1788 .order = -1,
1789 .mode = MIGRATE_SYNC,
1790 .ignore_skip_hint = true,
1791 .whole_zone = true,
1792 };
1793
1794 __compact_pgdat(NODE_DATA(nid), &cc);
1795}
1796
1797/* Compact all nodes in the system */ 1771/* Compact all nodes in the system */
1798static void compact_nodes(void) 1772static void compact_nodes(void)
1799{ 1773{