mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
When the page allocation fails, it's useful to be able to see the state of unaccounted memory in the system. Call the showmem notifier to get other clients to dump out their state. This is an example output with this patch. [ 457.125478] SLUB: Unable to allocate memory on node -1, gfp=0x2008000(GFP_NOWAIT|__GFP_ZERO) [ 457.133982] cache: kmalloc-128, object size: 128, buffer size: 640, default order: 2, min order: 0 [ 457.143179] node 0: slabs: 5903, objs: 132755, free: 26 [ 457.906076] BootAnimation: page allocation failure: order:0, mode:0x2204000(GFP_NOWAIT|__GFP_COMP|__GFP_NOTRACK) [ 457.916395] CPU: 2 PID: 4752 Comm: BootAnimation Not tainted 4.9.37+ #43 [ 457.916398] Hardware name: Qualcomm Technologies, Inc. SDM845 v1 MTP (DT) [ 457.916402] Call trace: [ 457.916420] [<ffffff82c5c89504>] dump_backtrace+0x0/0x2c4 [ 457.916426] [<ffffff82c5c897e8>] show_stack+0x20/0x28 [ 457.916434] [<ffffff82c5fea888>] dump_stack+0xb8/0xf4 [ 457.916442] [<ffffff82c5dd136c>] warn_alloc+0x154/0x170 [ 457.916447] [<ffffff82c5dd184c>] __alloc_pages_nodemask+0x430/0xcdc [ 457.916454] [<ffffff82c5e1c154>] new_slab+0x344/0x430 [ 457.916458] [<ffffff82c5e1e404>] ___slab_alloc.constprop.72+0x2f4/0x398 [ 457.916463] [<ffffff82c5e1e4f0>] __slab_alloc.isra.69.constprop.71+0x48/0x80 [ 457.916467] [<ffffff82c5e1ea24>] kmem_cache_alloc_trace+0x210/0x2dc [ 457.916476] [<ffffff82c68ebf0c>] binder_transaction+0x280/0x2008 [ 457.916480] [<ffffff82c68ee68c>] binder_thread_write+0x9f8/0x136c [ 457.916484] [<ffffff82c68f08d0>] binder_ioctl_write_read+0x14c/0x3b0 [ 457.916488] [<ffffff82c68f0df0>] binder_ioctl+0x2bc/0x868 [ 457.916494] [<ffffff82c5e451e4>] do_vfs_ioctl+0xd0/0x858 [ 457.916498] [<ffffff82c5e459fc>] SyS_ioctl+0x90/0xa4 [ 457.916503] [<ffffff82c5c83770>] el0_svc_naked+0x24/0x28 [ 457.916505] Mem-Info: [ 457.916515] active_anon:83629 inactive_anon:212 isolated_anon:0\x0a active_file:5955 inactive_file:5745 isolated_file:0\x0a unevictable:630956 dirty:0 writeback:0 unstable:0\x0a slab_recl aimable:16602 slab_unreclaimable:69384\x0a mapped:3609 shmem:308 pagetables:5737 bounce:0\x0a free:4446 free_pcp:482 free_cma:112 [ 457.916524] Node 0 active_anon:334516kB inactive_anon:848kB active_file:23820kB inactive_file:22980kB unevictable:2523824kB isolated(anon):0kB isolated(file):0kB mapped:14436kB dirty:0kB writeback:0kB shmem:1232kB writeback_tmp:0kB unstable:0kB pages_scanned:0 all_unreclaimable? no [ 457.916534] DMA free:12516kB min:3352kB low:4924kB high:6496kB active_anon:45336kB inactive_anon:64kB active_file:3588kB inactive_file:3404kB unevictable:1564224kB writepending:0kB presen t:1854120kB managed:1748064kB mlocked:1564224kB slab_reclaimable:10664kB slab_unreclaimable:24400kB kernel_stack:2608kB pagetables:6376kB bounce:0kB free_pcp:572kB local_pcp:0kB free_cma:448 kB [ 457.916536] lowmem_reserve[]: 0 1901 1901 [ 457.916550] Normal free:5268kB min:4148kB low:6092kB high:8036kB active_anon:289180kB inactive_anon:784kB active_file:20232kB inactive_file:19576kB unevictable:959600kB writepending:0kB p resent:2068224kB managed:1984196kB mlocked:959600kB slab_reclaimable:55744kB slab_unreclaimable:253136kB kernel_stack:19232kB pagetables:16572kB bounce:0kB free_pcp:1356kB local_pcp:116kB fr ee_cma:0kB [ 457.916552] lowmem_reserve[]: 0 0 0 [ 457.916560] DMA: 819*4kB (UMEC) 280*8kB (UMEC) 224*16kB (UME) 98*32kB (UME) 6*64kB (UME) 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 12620kB [ 457.916594] Normal: 1118*4kB (UMEH) 38*8kB (UMH) 1*16kB (H) 2*32kB (H) 1*64kB (H) 1*128kB (H) 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 5048kB [ 457.916627] 12071 total pagecache pages [ 457.916630] 0 pages in swap cache [ 457.916633] Swap cache stats: add 0, delete 0, find 0/0 [ 457.916634] Free swap = 0kB [ 457.916636] Total swap = 0kB [ 457.916639] 980586 pages RAM [ 457.916641] 0 pages HighMem/MovableOnly [ 457.916643] 47521 pages reserved [ 457.916645] 51200 pages cma reserved [ 457.916651] cma: cma-0 pages: => 0 used of 2048 total pages [ 457.916660] cma: cma-1 pages: => 0 used of 23552 total pages [ 457.916665] cma: cma-2 pages: => 1695 used of 3072 total pages [ 457.916670] cma: cma-3 pages: => 8277 used of 9216 total pages [ 457.916674] cma: cma-4 pages: => 186 used of 5120 total pages [ 457.916679] cma: cma-5 pages: => 3792 used of 8192 total pages [ 457.916685] Heap name Total heap size Total orphaned size [ 457.916687] --------------------------------- [ 457.916691] qsecom 0x ba000 0x 0 [ 457.916694] system 0x 44db000 0x 500000 [ 457.916705] ------------------------------------------------- [ 457.916708] uncached pool = 31027200 cached pool = 0 secure pool = 0 [ 457.916710] pool total (uncached + cached + secure) = 31027200 [ 457.916712] ------------------------------------------------- [ 457.916715] adsp 0x 614000 0x 0 [ 457.916720] spss 0x 0 0x 0 [ 457.916725] secure_display 0x 0 0x 0 [ 457.916727] secure_heap 0x 0 0x 0 Change-Id: Id01cce4abf331ff9c1c7ab9f0c0f9b1fc4146467 Signed-off-by: Prakash Gupta <guptap@codeaurora.org>