On Wed 02-03-16 13:24:10, Michal Hocko wrote: > On Tue 01-03-16 19:14:08, Vlastimil Babka wrote: [...] > > I would suggest enabling all compaction tracepoint and the migration > > tracepoint. Looking at the trace could hopefully help faster than > > going one trace_printk() per attempt. > > OK, here we go with both watermarks checks removed and hopefully all the > compaction related tracepoints enabled: > echo 1 > /debug/tracing/events/compaction/enable > echo 1 > /debug/tracing/events/migrate/mm_migrate_pages/enable > > this was without the hugetlb handicap. See the trace log and vmstat > after the run attached. Just for the reference the above was with: diff --git a/mm/compaction.c b/mm/compaction.c index 4d99e1f5055c..7364e48cf69a 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -1276,6 +1276,9 @@ static unsigned long __compaction_suitable(struct zone *zone, int order, alloc_flags)) return COMPACT_PARTIAL; + if (order <= PAGE_ALLOC_COSTLY_ORDER) + return COMPACT_CONTINUE; + /* * Watermarks for order-0 must be met for compaction. Note the 2UL. * This is because during migration, copies of pages need to be diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 1993894b4219..50954a9a4433 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -2245,7 +2245,6 @@ EXPORT_SYMBOL_GPL(split_page); int __isolate_free_page(struct page *page, unsigned int order) { - unsigned long watermark; struct zone *zone; int mt; @@ -2254,14 +2253,8 @@ int __isolate_free_page(struct page *page, unsigned int order) zone = page_zone(page); mt = get_pageblock_migratetype(page); - if (!is_migrate_isolate(mt)) { - /* Obey watermarks as if the page was being allocated */ - watermark = low_wmark_pages(zone) + (1 << order); - if (!zone_watermark_ok(zone, 0, watermark, 0, 0)) - return 0; - + if (!is_migrate_isolate(mt)) __mod_zone_freepage_state(zone, -(1UL << order), mt); - } /* Remove page from free list */ list_del(&page->lru); And I rerun the same with the clean mmotm tree and the results are attached. As we can see there was less scanning on dma32 both in direct and kswapd reclaim. $ grep direct vmstat.* vmstat.mmotm.log:pgsteal_direct_dma 420 vmstat.mmotm.log:pgsteal_direct_dma32 71234 vmstat.mmotm.log:pgsteal_direct_normal 0 vmstat.mmotm.log:pgsteal_direct_movable 0 vmstat.mmotm.log:pgscan_direct_dma 990 vmstat.mmotm.log:pgscan_direct_dma32 144376 vmstat.mmotm.log:pgscan_direct_normal 0 vmstat.mmotm.log:pgscan_direct_movable 0 vmstat.mmotm.log:pgscan_direct_throttle 0 vmstat.updated.log:pgsteal_direct_dma 334 vmstat.updated.log:pgsteal_direct_dma32 71877 vmstat.updated.log:pgsteal_direct_normal 0 vmstat.updated.log:pgsteal_direct_movable 0 vmstat.updated.log:pgscan_direct_dma 670 vmstat.updated.log:pgscan_direct_dma32 137488 vmstat.updated.log:pgscan_direct_normal 0 vmstat.updated.log:pgscan_direct_movable 0 vmstat.updated.log:pgscan_direct_throttle 0 $ grep kswapd vmstat.* vmstat.mmotm.log:pgsteal_kswapd_dma 5602 vmstat.mmotm.log:pgsteal_kswapd_dma32 332336 vmstat.mmotm.log:pgsteal_kswapd_normal 0 vmstat.mmotm.log:pgsteal_kswapd_movable 0 vmstat.mmotm.log:pgscan_kswapd_dma 12187 vmstat.mmotm.log:pgscan_kswapd_dma32 679667 vmstat.mmotm.log:pgscan_kswapd_normal 0 vmstat.mmotm.log:pgscan_kswapd_movable 0 vmstat.mmotm.log:kswapd_inodesteal 0 vmstat.mmotm.log:kswapd_low_wmark_hit_quickly 339 vmstat.mmotm.log:kswapd_high_wmark_hit_quickly 10 vmstat.updated.log:pgsteal_kswapd_dma 5339 vmstat.updated.log:pgsteal_kswapd_dma32 322951 vmstat.updated.log:pgsteal_kswapd_normal 0 vmstat.updated.log:pgsteal_kswapd_movable 0 vmstat.updated.log:pgscan_kswapd_dma 11213 vmstat.updated.log:pgscan_kswapd_dma32 653096 vmstat.updated.log:pgscan_kswapd_normal 0 vmstat.updated.log:pgscan_kswapd_movable 0 vmstat.updated.log:kswapd_inodesteal 0 vmstat.updated.log:kswapd_low_wmark_hit_quickly 351 vmstat.updated.log:kswapd_high_wmark_hit_quickly 13 -- Michal Hocko SUSE Labs