Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 39aaa5a6 authored by Minchan Kim's avatar Minchan Kim Committed by Pranav Vashi
Browse files

mm: allow __GFP_MOVABLE to use CMA memory

There was some report many 0-order page allocation failure[2] from zsmalloc.
It happened even though we have enough available free pages but yes, they are
mostly CMA area.

zsmalloc has supported migration so it should be no problem to use CMA memory.
That was the reason I made non-lru page migration[3] in MM. However, QC added
[1] to increase CMA memory utilization and breaks the rule that MIGRATE_MOVABLE
is inherently movable pages.

This patch restores __GFP_MOVABLE allocation from CMA memory.

[1] 2c0f71c8aac9, mm: add cma pcp list
[2] page allocation failure
[3] https://lwn.net/Articles/685231/



12-26 17:45:40.782 10133  8079  8079 W sync-preprocess: page allocation failure: order:0, mode:0x240000a(GFP_NOIO|__GFP_HIGHMEM|__GFP_MOVABLE)
12-26 17:45:40.782 10133  8079  8079 W Call trace:
12-26 17:45:40.782 10133  8079  8079 W         : [<ffffff86ec5d1a0c>] dump_backtrace+0x0/0x4
12-26 17:45:40.782 10133  8079  8079 W         : [<ffffff86eb2dc098>] dump_stack+0xcc/0x104
12-26 17:45:40.783 10133  8079  8079 W         : [<ffffff86eaf0ceb8>] warn_alloc+0xd4/0x15c
12-26 17:45:40.783 10133  8079  8079 W         : [<ffffff86eaf0b880>] __alloc_pages_nodemask+0xf5c/0xf6c
12-26 17:45:40.783 10133  8079  8079 W         : [<ffffff86eafa7e80>] zs_malloc+0x240/0x7c0
12-26 17:45:40.783 10133  8079  8079 W         : [<ffffff86eb7af48c>] zram_bvec_rw+0x28c/0xf3c
12-26 17:45:40.783 10133  8079  8079 W         : [<ffffff86eb7aeef4>] zram_rw_page+0xc0/0x1c4
12-26 17:45:40.783 10133  8079  8079 W         : [<ffffff86eb0252fc>] bdev_write_page+0x88/0x1b4
12-26 17:45:40.783 10133  8079  8079 W         : [<ffffff86eaf7bf38>] __swap_writepage+0x64/0x630
12-26 17:45:40.783 10133  8079  8079 W         : [<ffffff86eaf7bec8>] swap_writepage+0x90/0x9c
12-26 17:45:40.783 10133  8079  8079 W         : [<ffffff86eaf28240>] shrink_page_list+0x940/0x1418
12-26 17:45:40.783 10133  8079  8079 W         : [<ffffff86eaf26a48>] shrink_inactive_list+0x728/0xc8c
12-26 17:45:40.783 10133  8079  8079 W         : [<ffffff86eaf2544c>] shrink_node_memcg+0x3b8/0xb88
12-26 17:45:40.783 10133  8079  8079 W         : [<ffffff86eaf24a0c>] shrink_node+0x258/0x48c
12-26 17:45:40.783 10133  8079  8079 W         : [<ffffff86eaf2c304>] do_try_to_free_pages+0x270/0x328
12-26 17:45:40.783 10133  8079  8079 W         : [<ffffff86eaf2becc>] try_to_free_pages+0x894/0xa5c
12-26 17:45:40.783 10133  8079  8079 W         : [<ffffff86eaf0af8c>] __alloc_pages_nodemask+0x668/0xf6c
12-26 17:45:40.783 10133  8079  8079 W         : [<ffffff86eaf19780>] __do_page_cache_readahead+0x150/0x42c
12-26 17:45:40.783 10133  8079  8079 W         : [<ffffff86eaf19c6c>] ondemand_readahead+0x210/0x3c0
12-26 17:45:40.783 10133  8079  8079 W         : [<ffffff86eaf02930>] generic_file_read_iter+0x1a0/0xda4
12-26 17:45:40.783 10133  8079  8079 W         : [<ffffff86eafb0e70>] __vfs_read+0x104/0x1a4
12-26 17:45:40.783 10133  8079  8079 W         : [<ffffff86eafb0cd4>] vfs_read+0xa0/0x138
12-26 17:45:40.783 10133  8079  8079 W         : [<ffffff86eb164ce0>] sdcardfs_read+0x20/0x44
12-26 17:45:40.783 10133  8079  8079 W         : [<ffffff86eafb0db8>] __vfs_read+0x4c/0x1a4
12-26 17:45:40.783 10133  8079  8079 W         : [<ffffff86eafb0cd4>] vfs_read+0xa0/0x138
12-26 17:45:40.783 10133  8079  8079 W         : [<ffffff86eafb2b0c>] SyS_read+0x9c/0x12c
12-26 17:45:40.783 10133  8079  8079 W         : [<ffffff86eac8425c>] __sys_trace_return+0x0/0x4
12-26 17:45:40.783 10133  8079  8079 W warn_alloc_show_mem: 1 callbacks suppressed
12-26 17:45:40.783 10133  8079  8079 W Mem-Info:
12-26 17:45:40.783 10133  8079  8079 W active_anon: 47148 inactive_anon:47161 isolated_anon:0
12-26 17:45:40.783 10133  8079  8079 W active_file: 285389 inactive_file:90997 isolated_file:0
12-26 17:45:40.783 10133  8079  8079 W unevictable: 43387 dirty:27 writeback:220 unstable:0
12-26 17:45:40.783 10133  8079  8079 W slab_reclaimable: 14386 slab_unreclaimable:42885
12-26 17:45:40.783 10133  8079  8079 W mapped  : 89490 shmem:469 pagetables:14675 bounce:0
12-26 17:45:40.783 10133  8079  8079 W free    : 24795 free_pcp:1566 free_cma:22288 zspages: 63866
12-26 17:45:40.783 10133  8079  8079 W ion_heap: 120822 ion_heap_pool:255
12-26 17:45:40.783 10133  8079  8079 W         : Node 0 active_anon:188592kB inactive_anon:188644kB active_file:1141556kB inactive_file:363988kB unevictable:173548kB isolated(anon):0kB isolated(file):0kB mapped:357960kB dirty:108kB writeback:880kB shmem:1876kB writeback_tmp:0kB unstable:0kB all_unreclaimable? no
12-26 17:45:40.783 10133  8079  8079 W DMA free: 92380kB min:3400kB low:16376kB high:17224kB active_anon:79144kB inactive_anon:74504kB active_file:513412kB inactive_file:170572kB unevictable:84192kB writepending:752kB present:1804896kB managed:1691308kB mlocked:84192kB slab_reclaimable:21488kB slab_unreclaimable:67072kB kernel_stack:23696kB pagetables:20552kB bounce:0kB free_pcp:3544kB local_pcp:100kB free_cma:89152kB
12-26 17:45:40.783 10133  8079  8079 W Normal free: 6800kB min:4000kB low:19272kB high:20272kB active_anon:109872kB inactive_anon:113656kB active_file:627396kB inactive_file:194108kB unevictable:89356kB writepending:236kB present:2067200kB managed:1990540kB mlocked:89356kB slab_reclaimable:36056kB slab_unreclaimable:104468kB kernel_stack:22400kB pagetables:38148kB bounce:0kB free_pcp:2720kB local_pcp:80kB free_cma:0kB
12-26 17:45:40.783 10133  8079  8079 W DMA     : 66*4kB (H) 2665*8kB (CH) 1492*16kB (CH) 529*32kB (CH) 307*64kB (CH) 72*128kB (CH) 4*256kB (C) 0*512kB 0*1024kB 0*2048kB 0*4096kB = 92272kB
12-26 17:45:40.783 10133  8079  8079 W         : 653 pages in swap cache
12-26 17:45:40.783 10133  8079  8079 W         : Swap cache stats: add 1169372, delete 1168719, find 72740/436693
12-26 17:45:40.783 10133  8079  8079 W         : Free swap  = 172kB

Bug: 134689899
Bug: 123392992
Change-Id: I9d792f58d958bc86da340e7d49c23b08f8997b34
Signed-off-by: default avatarMinchan Kim <minchan@google.com>
(cherry picked from commit 127b34ddc60fa317d1da062ce579033b52b61bf4)
Signed-off-by: default avatarPranav Vashi <neobuddy89@gmail.com>
parent 68fdb324
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment