Re: [PATCH 0/3] OOM detection rework v4

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Attachment: trace.mmotm.log.gz
Description: application/gzip

nr_free_pages 149226
nr_alloc_batch 114
nr_inactive_anon 13962
nr_active_anon 46754
nr_inactive_file 634
nr_active_file 5010
nr_unevictable 0
nr_mlock 0
nr_anon_pages 219
nr_mapped 793
nr_file_pages 66233
nr_dirty 0
nr_writeback 0
nr_slab_reclaimable 12355
nr_slab_unreclaimable 21208
nr_page_table_pages 320
nr_kernel_stack 92
nr_unstable 0
nr_bounce 0
nr_vmscan_write 358705
nr_vmscan_immediate_reclaim 111
nr_writeback_temp 0
nr_isolated_anon 0
nr_isolated_file 0
nr_shmem 58505
nr_dirtied 5516
nr_written 360677
nr_pages_scanned 0
workingset_refault 17291
workingset_activate 11908
workingset_nodereclaim 644
nr_anon_transparent_hugepages 0
nr_free_cma 0
nr_dirty_threshold 30487
nr_dirty_background_threshold 15243
pgpgin 525267
pgpgout 1444464
pswpin 75386
pswpout 358705
pgalloc_dma 241466
pgalloc_dma32 21491760
pgalloc_normal 0
pgalloc_movable 0
pgfree 22110844
pgactivate 204005
pgdeactivate 1033621
pgfault 23929641
pgmajfault 27748
pglazyfreed 0
pgrefill_dma 18759
pgrefill_dma32 1122090
pgrefill_normal 0
pgrefill_movable 0
pgsteal_kswapd_dma 5602
pgsteal_kswapd_dma32 332336
pgsteal_kswapd_normal 0
pgsteal_kswapd_movable 0
pgsteal_direct_dma 420
pgsteal_direct_dma32 71234
pgsteal_direct_normal 0
pgsteal_direct_movable 0
pgscan_kswapd_dma 12187
pgscan_kswapd_dma32 679667
pgscan_kswapd_normal 0
pgscan_kswapd_movable 0
pgscan_direct_dma 990
pgscan_direct_dma32 144376
pgscan_direct_normal 0
pgscan_direct_movable 0
pgscan_direct_throttle 0
pginodesteal 0
slabs_scanned 2052
kswapd_inodesteal 0
kswapd_low_wmark_hit_quickly 339
kswapd_high_wmark_hit_quickly 10
pageoutrun 448
allocstall 1376
pgrotated 357091
drop_pagecache 0
drop_slab 0
pgmigrate_success 227102
pgmigrate_fail 142
compact_migrate_scanned 374515
compact_free_scanned 4000566
compact_isolated 456131
compact_stall 133
compact_fail 73
compact_success 60
compact_kcompatd_wake 0
htlb_buddy_alloc_success 0
htlb_buddy_alloc_fail 0
unevictable_pgs_culled 1087
unevictable_pgs_scanned 0
unevictable_pgs_rescued 1530
unevictable_pgs_mlocked 1530
unevictable_pgs_munlocked 1529
unevictable_pgs_cleared 1
unevictable_pgs_stranded 0
thp_fault_alloc 164
thp_fault_fallback 26
thp_collapse_alloc 159
thp_collapse_alloc_failed 11
thp_split_page 0
thp_split_page_failed 0
thp_deferred_split_page 309
thp_split_pmd 7
thp_zero_page_alloc 3
thp_zero_page_alloc_failed 0

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]