Re: Silent hang up caused by pages being not scanned?

From: Tetsuo Handa
Date: Tue Oct 13 2015 - 12:19:20 EST


Michal Hocko wrote:
> I can see two options here. Either we teach zone_reclaimable to be less
> fragile or remove zone_reclaimable from shrink_zones altogether. Both of
> them are risky because we have a long history of changes in this areas
> which made other subtle behavior changes but I guess that the first
> option should be less fragile. What about the following patch? I am not
> happy about it because the condition is rather rough and a deeper
> inspection is really needed to check all the call sites but it should be
> good for testing.

While zone_reclaimable() for Node 0 DMA32 became false by your patch,
zone_reclaimable() for Node 0 DMA kept returning true, and as a result
overall result (i.e. zones_reclaimable) remained true.

$ ./a.out

---------- When there is no data to write ----------
[ 162.942371] MIN=11163 FREE=11155 (ACTIVE_FILE=0+INACTIVE_FILE=0) * 6 > PAGES_SCANNED=16
[ 162.944541] MIN=100 FREE=1824 (ACTIVE_FILE=3+INACTIVE_FILE=0) * 6 > PAGES_SCANNED=5
[ 162.946560] zone_reclaimable returned 1 at line 2665
[ 162.948722] shrink_zones returned 1 at line 2716
(...snipped...)
[ 164.897587] zones_reclaimable=1 at line 2775
[ 164.899172] do_try_to_free_pages returned 1 at line 2948
[ 167.087119] __perform_reclaim returned 1 at line 2854
[ 167.088868] did_some_progress=1 at line 3301
(...snipped...)
[ 261.577944] MIN=11163 FREE=11155 (ACTIVE_FILE=0+INACTIVE_FILE=0) * 6 > PAGES_SCANNED=0
[ 261.580093] MIN=100 FREE=1824 (ACTIVE_FILE=3+INACTIVE_FILE=0) * 6 > PAGES_SCANNED=5
[ 261.582333] zone_reclaimable returned 1 at line 2665
[ 261.583841] shrink_zones returned 1 at line 2716
(...snipped...)
[ 264.728434] zones_reclaimable=1 at line 2775
[ 264.730002] do_try_to_free_pages returned 1 at line 2948
[ 268.191368] __perform_reclaim returned 1 at line 2854
[ 268.193113] did_some_progress=1 at line 3301
---------- When there is no data to write ----------

Complete log (with your patch inside) is at
http://I-love.SAKURA.ne.jp/tmp/serial-20151014.txt.xz .

By the way, the OOM killer seems to be invoked prematurely for different load
if your patch is applied.

$ cat < /dev/zero > /tmp/log & sleep 10; ./a.out

---------- When there is a lot of data to write ----------
[ 69.019271] Mem-Info:
[ 69.019755] active_anon:335006 inactive_anon:2084 isolated_anon:23
[ 69.019755] active_file:12197 inactive_file:65310 isolated_file:31
[ 69.019755] unevictable:0 dirty:533 writeback:51020 unstable:0
[ 69.019755] slab_reclaimable:4753 slab_unreclaimable:4134
[ 69.019755] mapped:9639 shmem:2144 pagetables:2030 bounce:0
[ 69.019755] free:12972 free_pcp:45 free_cma:0
[ 69.026260] Node 0 DMA free:7300kB min:400kB low:500kB high:600kB active_anon:5232kB inactive_anon:96kB active_file:424kB inactive_file:1068kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:15988kB managed:15904kB mlocked:0kB dirty:164kB writeback:972kB mapped:416kB shmem:104kB slab_reclaimable:304kB slab_unreclaimable:244kB kernel_stack:96kB pagetables:256kB unstable:0kB bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:0kB writeback_tmp:0kB pages_scanned:128 all_unreclaimable? no
[ 69.037189] lowmem_reserve[]: 0 1729 1729 1729
[ 69.039152] Node 0 DMA32 free:74224kB min:44652kB low:55812kB high:66976kB active_anon:1334792kB inactive_anon:8240kB active_file:48364kB inactive_file:230752kB unevictable:0kB isolated(anon):92kB isolated(file):0kB present:2080640kB managed:1774264kB mlocked:0kB dirty:9328kB writeback:199060kB mapped:38140kB shmem:8472kB slab_reclaimable:17840kB slab_unreclaimable:16292kB kernel_stack:3840kB pagetables:7864kB unstable:0kB bounce:0kB free_pcp:784kB local_pcp:0kB free_cma:0kB writeback_tmp:0kB pages_scanned:0 all_unreclaimable? no
[ 69.052017] lowmem_reserve[]: 0 0 0 0
[ 69.053818] Node 0 DMA: 17*4kB (UME) 8*8kB (UME) 6*16kB (UME) 2*32kB (UM) 2*64kB (UE) 4*128kB (UME) 1*256kB (U) 2*512kB (UE) 3*1024kB (UME) 1*2048kB (U) 0*4096kB = 7332kB
[ 69.059597] Node 0 DMA32: 632*4kB (UME) 454*8kB (UME) 507*16kB (UME) 310*32kB (UME) 177*64kB (UE) 61*128kB (UME) 15*256kB (ME) 19*512kB (M) 10*1024kB (M) 0*2048kB 0*4096kB = 67136kB
[ 69.065810] Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=2048kB
[ 69.068305] 72477 total pagecache pages
[ 69.069932] 0 pages in swap cache
[ 69.071435] Swap cache stats: add 0, delete 0, find 0/0
[ 69.073354] Free swap = 0kB
[ 69.074822] Total swap = 0kB
[ 69.076660] 524157 pages RAM
[ 69.078113] 0 pages HighMem/MovableOnly
[ 69.079930] 76615 pages reserved
[ 69.081406] 0 pages hwpoisoned
---------- When there is a lot of data to write ----------
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/