From 44d72048f466559de53644c1c1e9f233b2dd701a Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Jan 31 2017 16:40:57 +0000 Subject: Fix CMA compaction regression (Raspberry Pi and others) --- diff --git a/kernel.spec b/kernel.spec index e49b818..e563e5b 100644 --- a/kernel.spec +++ b/kernel.spec @@ -529,6 +529,8 @@ Patch432: bcm283x-fixes.patch # http://www.spinics.net/lists/linux-mmc/msg41151.html Patch433: bcm283x-mmc-imp-speed.patch +Patch434: mm-alloc_contig-re-allow-CMA-to-compact-FS-pages.patch + Patch440: AllWinner-net-emac.patch Patch442: ARM-Drop-fixed-200-Hz-timer-requirement-from-Samsung-platforms.patch @@ -2184,6 +2186,9 @@ fi # # %changelog +* Tue Jan 31 2017 Peter Robinson +- Fix CMA compaction regression (Raspberry Pi and others) + * Thu Jan 26 2017 Peter Robinson - arm64: dma-mapping: Fix dma_mapping_error() when bypassing SWIOTLB diff --git a/mm-alloc_contig-re-allow-CMA-to-compact-FS-pages.patch b/mm-alloc_contig-re-allow-CMA-to-compact-FS-pages.patch new file mode 100644 index 0000000..0e542dc --- /dev/null +++ b/mm-alloc_contig-re-allow-CMA-to-compact-FS-pages.patch @@ -0,0 +1,42 @@ +From 424f6c4818bbf1b8ccf58aa012ecc19c0bb9b446 Mon Sep 17 00:00:00 2001 +From: Lucas Stach +Date: Tue, 24 Jan 2017 15:18:05 -0800 +Subject: [PATCH 179/273] mm: alloc_contig: re-allow CMA to compact FS pages + +Commit 73e64c51afc5 ("mm, compaction: allow compaction for GFP_NOFS +requests") changed compation to skip FS pages if not explicitly allowed +to touch them, but missed to update the CMA compact_control. + +This leads to a very high isolation failure rate, crippling performance +of CMA even on a lightly loaded system. Re-allow CMA to compact FS +pages by setting the correct GFP flags, restoring CMA behavior and +performance to the kernel 4.9 level. + +Fixes: 73e64c51afc5 (mm, compaction: allow compaction for GFP_NOFS requests) +Link: http://lkml.kernel.org/r/20170113115155.24335-1-l.stach@pengutronix.de +Signed-off-by: Lucas Stach +Acked-by: Michal Hocko +Acked-by: Vlastimil Babka +Cc: Joonsoo Kim +Cc: Mel Gorman +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +--- + mm/page_alloc.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/mm/page_alloc.c b/mm/page_alloc.c +index d604d25..41d5e2e 100644 +--- a/mm/page_alloc.c ++++ b/mm/page_alloc.c +@@ -7248,6 +7248,7 @@ int alloc_contig_range(unsigned long start, unsigned long end, + .zone = page_zone(pfn_to_page(start)), + .mode = MIGRATE_SYNC, + .ignore_skip_hint = true, ++ .gfp_mask = GFP_KERNEL, + }; + INIT_LIST_HEAD(&cc.migratepages); + +-- +2.9.3 +