hi Michal: > I would just mark NR_FREE_PAGES before and after allocation request. > Something like: > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index f8f3bfc435ee..a1337aa7e897 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -3565,6 +3565,9 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order, > enum compact_result compact_result; > int compaction_retries = 0; > int no_progress_loops = 0; > + unsigned long nr_free_before; > + > + nr_free_before = global_page_state(NR_FREE_PAGES); > > /* > * In the slowpath, we sanity check order to avoid ever trying to > @@ -3624,6 +3627,7 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order, > * to fail. > */ > WARN_ON_ONCE(gfp_mask & __GFP_NOFAIL); > + pr_info("nr_free_before:%lu nr_free_now:%lu\n", nr_free_before, global_page_state(NR_FREE_PAGES)); > goto nopage; > } > > You can then compare the numbers before after and the allocation failure > to see whether there is a large gap. I follow your suggestion to add nr_free_before for comparing when allocation failure comes out. from the log, it shows that nr_free_before has lot of free pages and the value is the same even allocation fail. It seems there are some other conditions that will let page order =0 with GFP_ATOMIC (mode = 0x20) fail even free pages and pcp is enough. Sincerely appreciate your kind help, nr_free_before:14094 nr_free_now:14094 opera_omi: page allocation failure: order:0, mode:0x20 CPU: 0 PID: 20846 Comm: opera_omi Tainted: G O 3.10.0+ #14 Backtrace: [] (dump_backtrace+0x0/0x114) from [] (show_stack+0x20/0x24) r6:ca01e000 r5:00000000 r4:00000020 r3:271ae71c [] (show_stack+0x0/0x24) from [] (dump_stack+0x24/0x28) [] (dump_stack+0x0/0x28) from [] (warn_alloc_failed+0xec/0x128) [] (warn_alloc_failed+0x0/0x128) from [] (__alloc_pages_nodemask+0x748/0x97c) r3:00000000 r2:00000000 r7:c07fe240 r6:00000000 r5:00000000 r4:00000020 [] (__alloc_pages_nodemask+0x0/0x97c) from [] (__netdev_alloc_frag+0x1cc/0x1e8) [] (__netdev_alloc_frag+0x0/0x1e8) from [] (__netdev_alloc_skb+0x84/0xe0) [] (__netdev_alloc_skb+0x0/0xe0) from [] (_rtw_skb_alloc+0x3c/0x40 [8812au]) r6:0000007a r5:d4899168 r4:000000b6 r3:00000100 [] (_rtw_skb_alloc+0x0/0x40 [8812au]) from [] (rtw_os_alloc_recvframe+0x6c/0xfc [8812au]) [] (rtw_os_alloc_recvframe+0x0/0xfc [8812au]) from [] (recvbuf2recvframe+0x234/0x388 [8812au]) [] (recvbuf2recvframe+0x0/0x388 [8812au]) from [] (usb_recv_tasklet+0x6c/0x94 [8812au]) [] (usb_recv_tasklet+0x0/0x94 [8812au]) from [] (tasklet_action+0xa8/0x178) r7:c07b25ec r6:00000000 r5:d4809b5c r4:d4809b58 [] (tasklet_action+0x0/0x178) from [] (__do_softirq+0x164/0x344) r8:cd919484 r7:00000018 r6:c07b8098 r5:ca01e000 r4:00000006 r3:c002dd7c [] (__do_softirq+0x0/0x344) from [] (irq_exit+0xbc/0xf0) [] (irq_exit+0x0/0xf0) from [] (handle_IRQ+0x54/0xa0) r5:00000056 r4:c07b3f40 [] (handle_IRQ+0x0/0xa0) from [] (gic_handle_irq+0x3c/0x6c) r6:ca01fa00 r5:c07c82cc r4:feffe10c r3:00000000 [] (gic_handle_irq+0x0/0x6c) from [] (__irq_svc+0x44/0x78) Exception stack(0xca01fa00 to 0xca01fa48) fa00: cd919484 00000000 deaf1eed 80000001 cd919484 ca01fac0 00003175 00000000 fa20: cd919484 00000000 0000000c ca01fa5c ca01fa60 ca01fa48 c0570e0c c0294ee8 fa40: 880f0153 ffffffff 00000000 r7:ca01fa34 r6:ffffffff r5:880f0153 r4:c0294ee8 [] (do_raw_read_lock+0x0/0x54) from [] (_raw_read_lock+0x28/0x2c) r4:cd919484 r3:00000000 [] (_raw_read_lock+0x0/0x2c) from [] (ext4_es_lookup_extent+0x30/0x1dc) r4:cd9192c8 r3:00000000 [] (ext4_es_lookup_extent+0x0/0x1dc) from [] (ext4_map_blocks+0x40/0x4cc) r8:00000000 r7:00000000 r6:cd9192c8 r5:00000000 r4:ca01fb18 r3:00000000 [] (ext4_map_blocks+0x0/0x4cc) from [] (_ext4_get_block+0x94/0x188) [] (_ext4_get_block+0x0/0x188) from [] (ext4_get_block+0x34/0x3c) r9:00000000 r8:ca01fc40 r7:00000000 r6:00003175 r5:00000001 r4:00000000 [] (ext4_get_block+0x0/0x3c) from [] (do_mpage_readpage+0x5ac/0x748) [] (do_mpage_readpage+0x0/0x748) from [] (mpage_readpages+0xdc/0x138) [] (mpage_readpages+0x0/0x138) from [] (ext4_readpages+0x50/0x54) [] (ext4_readpages+0x0/0x54) from [] (__do_page_cache_readahead+0x1ac/0x260) r6:0000369a r5:00000020 r4:c01b52cc r3:00000014 [] (__do_page_cache_readahead+0x0/0x260) from [] (ra_submit+0x38/0x40) [] (ra_submit+0x0/0x40) from [] (filemap_fault+0x3e4/0x438) [] (filemap_fault+0x0/0x438) from [] (__do_fault+0x80/0x5d4) [] (__do_fault+0x0/0x5d4) from [] (handle_pte_fault+0x84/0x6b0) [] (handle_pte_fault+0x0/0x6b0) from [] (handle_mm_fault+0x8c/0xbc) [] (handle_mm_fault+0x0/0xbc) from [] (do_page_fault+0x310/0x428) [] (do_page_fault+0x0/0x428) from [] (do_DataAbort+0x48/0xac) [] (do_DataAbort+0x0/0xac) from [] (__dabt_usr+0x3c/0x40) Exception stack(0xca01ffb0 to 0xca01fff8) ffa0: 599ccd49 b59735cc 000048c4 b5e3784c ffc0: 019e6fc8 b5e24cb8 00100080 00000000 be539aec 0196fc00 be5399e0 019e6fc8 ffe0: 00020817 be5398a0 b3bd4765 b3cf394a 280f0170 ffffffff ff131313 r8:be539aec r7:00000000 r6:ffffffff r5:280f0170 r4:b3cf394a Mem-info: Normal per-cpu: CPU 0: hi: 90, btch: 15 usd: 11 CPU 1: hi: 90, btch: 15 usd: 21 HighMem per-cpu: CPU 0: hi: 18, btch: 3 usd: 1 CPU 1: hi: 18, btch: 3 usd: 2 active_anon:54429 inactive_anon:1744 isolated_anon:0 active_file:2226 inactive_file:3338 isolated_file:0 unevictable:0 dirty:44 writeback:0 unstable:0 free:14094 slab_reclaimable:1380 slab_unreclaimable:6532 mapped:4755 shmem:1772 pagetables:1106 bounce:0 free_cma:13863 Normal free:56088kB min:2000kB low:2500kB high:3000kB active_anon:148332kB inactive_anon:6040kB active_file:1356kB inactive_file:5240kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:329728kB managed:250408kB mlocked:0kB dirty:120kB writeback:0kB mapped:8108kB shmem:6136kB slab_reclaimable:5520kB slab_unreclaimable:26128kB kernel_stack:2720kB pagetables:4424kB unstable:0kB bounce:0kB free_cma:55452kB writeback_tmp:0kB pages_scanned:0 all_unreclaimable? no lowmem_reserve[]: 0 696 696 HighMem free:288kB min:128kB low:304kB high:480kB active_anon:69384kB inactive_anon:936kB active_file:7548kB inactive_file:8112kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:89088kB managed:89088kB mlocked:0kB dirty:56kB writeback:0kB mapped:10912kB shmem:952kB slab_reclaimable:0kB slab_unreclaimable:0kB kernel_stack:0kB pagetables:0kB unstable:0kB bounce:0kB free_cma:0kB writeback_tmp:0kB pages_scanned:11 all_unreclaimable? no lowmem_reserve[]: 0 0 0 Normal: 2152*4kB (UEC) 2157*8kB (UEC) 1889*16kB (UEC) 0*32kB 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 56088kB HighMem: 10*4kB (R) 21*8kB (R) 1*16kB (R) 0*32kB 1*64kB (R) 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 288kB 7360 total pagecache pages 0 pages in swap cache Swap cache stats: add 0, delete 0, find 0/0 Free swap = 0kB Total swap = 0kB RTL871X: rtw_os_alloc_recvframe:can not allocate memory for skb copy RTL871X: pre_recv_entry()-274: alloc_skb() failed!