Kernel page allocation failure:

Dears

I have the following error during boot of Banana.

bpi-r2 kernel:  ip: page allocation failure: order:10, mode:0x140c0c0(GFP_KERNEL|__GFP_COMP|__GFP_ZERO), nodemask=(null)
bpi-r2 kernel:  ip cpuset=/ mems_allowed=0
bpi-r2 kernel:  CPU: 0 PID: 599 Comm: ip Not tainted 4.14.158-bpi-r2 #4
bpi-r2 kernel:  Hardware name: Mediatek Cortex-A7 (Device Tree)
bpi-r2 kernel:  (show_stack+0x20/0x24)
bpi-r2 kernel:  (dump_stack+0xc4/0xd8)
bpi-r2 kernel:  (warn_alloc+0xc8/0x17c)
bpi-r2 kernel:  (__alloc_pages_nodemask+0x1190/0x11d0)
bpi-r2 kernel:  (kmalloc_order+0x28/0x40)
bpi-r2 kernel:  (kmalloc_order_trace+0x2c/0xd8)
bpi-r2 kernel:  (mtk_open+0xf0/0x610)
bpi-r2 kernel:  (__dev_open+0xbc/0x124)
bpi-r2 kernel:  (__dev_change_flags+0x184/0x1ac)
bpi-r2 kernel:  (dev_change_flags+0x28/0x58)
bpi-r2 kernel:  (do_setlink+0x330/0x984)
bpi-r2 kernel:  (rtnl_newlink+0x4d0/0x7f8)
bpi-r2 kernel:  (rtnetlink_rcv_msg+0x224/0x294)
bpi-r2 kernel:  (netlink_rcv_skb+0xd0/0xf0)
bpi-r2 kernel:  (rtnetlink_rcv+0x20/0x24)
bpi-r2 kernel:  (netlink_unicast+0x194/0x224)
bpi-r2 kernel:  (netlink_sendmsg+0x284/0x358)
bpi-r2 kernel:  (sock_sendmsg+0x24/0x34)
bpi-r2 kernel:  (___sys_sendmsg+0x200/0x210)
bpi-r2 kernel:  (__sys_sendmsg+0x50/0x7c)

bpi-r2 kernel:  (__dev_change_flags+0x184/0x1ac)
bpi-r2 kernel:  (dev_change_flags+0x28/0x58)
bpi-r2 kernel:  (do_setlink+0x330/0x984)
bpi-r2 kernel:  (rtnl_newlink+0x4d0/0x7f8)
bpi-r2 kernel:  (rtnetlink_rcv_msg+0x224/0x294)
bpi-r2 kernel:  (netlink_rcv_skb+0xd0/0xf0)
bpi-r2 kernel:  (rtnetlink_rcv+0x20/0x24)
bpi-r2 kernel:  (netlink_unicast+0x194/0x224)
bpi-r2 kernel:  (netlink_sendmsg+0x284/0x358)
bpi-r2 kernel:  (sock_sendmsg+0x24/0x34)
bpi-r2 kernel:  (___sys_sendmsg+0x200/0x210)
bpi-r2 kernel:  (__sys_sendmsg+0x50/0x7c)
bpi-r2 kernel:  (SyS_sendmsg+0x18/0x1c)
bpi-r2 kernel:  (ret_fast_syscall+0x0/0x54)
bpi-r2 kernel:  Mem-Info:
bpi-r2 kernel:  active_anon:1624 inactive_anon:4426 isolated_anon:0
bpi-r2 kernel:   active_file:11167 inactive_file:103815 isolated_file:15
bpi-r2 kernel:   unevictable:0 dirty:71 writeback:0 unstable:0
bpi-r2 kernel:   slab_reclaimable:3271 slab_unreclaimable:2901
bpi-r2 kernel:   mapped:1777 shmem:4461 pagetables:100 bounce:0
bpi-r2 kernel:   free:384738 free_pcp:87 free_cma:15198
bpi-r2 kernel:  Node 0 active_anon:6496kB inactive_anon:17704kB active_file:44668kB inactive_file:415696kB unevictable:0kB isolated(anon):0kB isolated(file):60kB mapped:7108kB dirt
y:284kB writeback:0kB shmem:17844kB writeback_tmp:0kB unstable:0kB all_unreclaimable? no
bpi-r2 kernel:  Normal free:19228kB min:2808kB low:3508kB high:4208kB active_anon:0kB inactive_anon:0kB active_file:36592kB inactive_file:409324kB unevictable:0kB writepending:276k
B present:532480kB managed:495228kB mlocked:0kB kernel_stack:936kB pagetables:0kB bounce:0kB free_pcp:192kB local_pcp:0kB free_cma:0kB
bpi-r2 kernel: : 0 11703 11703
bpi-r2 kernel:  HighMem free:1518732kB min:512kB low:2640kB high:4768kB active_anon:6496kB inactive_anon:17704kB active_file:8200kB inactive_file:6724kB unevictable:0kB writependin
g:8kB present:1563644kB managed:1563644kB mlocked:0kB kernel_stack:0kB pagetables:400kB bounce:0kB free_pcp:124kB local_pcp:0kB free_cma:60792kB
bpi-r2 kernel: : 0 0 0
bpi-r2 kernel:  Normal: 5*4kB (UME) 9*8kB (ME) 11*16kB (UME) 7*32kB (ME) 27*64kB (UME) 21*128kB (UE) 17*256kB (UE) 7*512kB (UE) 4*1024kB (U) 1*2048kB (E) 0*4096kB 0*8192kB = 18988k
B
bpi-r2 kernel:  HighMem: 217*4kB (MC) 103*8kB (UM) 35*16kB (UMC) 33*32kB (UMC) 19*64kB (UM) 5*128kB (UM) 3*256kB (UC) 1*512kB (U) 3*1024kB (UMC) 1*2048kB (C) 2*4096kB (UM) 183*8192
kB (MC) = 1518892kB
bpi-r2 kernel:  120145 total pagecache pages
bpi-r2 kernel:  0 pages in swap cache
bpi-r2 kernel:  Swap cache stats: add 0, delete 0, find 0/0
bpi-r2 kernel:  Free swap  = 0kB
bpi-r2 kernel:  Total swap = 0kB
bpi-r2 kernel:  524031 pages RAM
bpi-r2 kernel:  390911 pages HighMem/MovableOnly
bpi-r2 kernel:  9313 pages reserved
bpi-r2 kernel:  16384 pages cma reserved

It happens on boot ( not every time). Sometimes I also got similar error during normal operation:

Jan 27 20:14:25 bpi-r2 kernel: [ 7903.742622] [<c0240554>] (warn_alloc) from [<c024184c>] (__alloc_pages_nodemask+0x1190/0x11d0)

Jan 27 20:14:25 bpi-r2 kernel: [ 7903.751175] [<c024184c>] (__alloc_pages_nodemask) from [<c0241a74>] (page_frag_alloc+0x148/0x15c)

Jan 27 20:14:25 bpi-r2 kernel: [ 7903.759989] [<c0241a74>] (page_frag_alloc) from [<c089f424>] (napi_alloc_frag+0x34/0x3c)

Kernel 4.14.158

I assume that there are memory problems, since I extensively use MD mirroring. Any idea how to get rid of these messages please .

Regards J

This looks like a network issue i currently facing on my ubuntu workstation with an realtek 8153.

Do you use r8152 module (for realtek 815x usb ethernet adapter)?

I get this till 5.3 and in 5.4 it seems to be fixed

No - only build-in Eth

root@bpi-r2:~# lsmod
Module                  Size  Used by
mtk_thermal            16384  0
spi_mt65xx             20480  0
thermal_sys            61440  1 mtk_thermal
pwm_mediatek           16384  0
mt6577_auxadc          16384  0
rtc_mt6397             16384  1
nvmem_mtk_efuse        16384  0
rtc_ds1307             28672  0
i2c_dev                20480  0

Mhm,could you try newer kernel (e.g. 5.4)? Have not seen this on my r2 (also 4.14 but .130 i guess).but i do not use md

I will try. In the mean-time I give additional messages. The problem is pretty reproducible. When I got “page allocation failure” the memory state is:

# cat /proc/meminfo
MemTotal:        2061092 kB
MemFree:         1522984 kB
MemAvailable:    1942328 kB
Buffers:          431412 kB
Cached:            56136 kB
SwapCached:            0 kB
Active:            54584 kB
Inactive:         440476 kB
Active(anon):       7652 kB
Inactive(anon):    17724 kB
Active(file):      46932 kB
Inactive(file):   422752 kB
Unevictable:           0 kB
Mlocked:               0 kB
HighTotal:       1563644 kB
HighFree:        1492728 kB
LowTotal:         497448 kB
LowFree:           30256 kB
SwapTotal:             0 kB
SwapFree:              0 kB
Dirty:                12 kB
Writeback:             0 kB
AnonPages:          7544 kB
Mapped:            12968 kB
Shmem:             17884 kB
Slab:              29660 kB
SReclaimable:      17912 kB
SUnreclaim:        11748 kB
KernelStack:         912 kB
PageTables:          404 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:     1030544 kB
Committed_AS:      69104 kB
VmallocTotal:     499712 kB
VmallocUsed:           0 kB
VmallocChunk:          0 kB
CmaTotal:          65536 kB
CmaFree:           60792 kB

Can some of you guy look at this ?

I hope that the problem will be alleviated if kernel huge pages would be enabled. If I try to set CONFIG_HUGETLB_PAGE=y in .config, no matter how I tried, it is be overwritten by make oldconfig or build.sh.

In the mean time I try to download 5.4 with the command

git clone https://github.com/frank-w/BPI-R2-4.14.git --branch 5.4-main

hope that 5.4 is cloned.

afair you need additional --single-branch and checkout to branch after clone (was in detached head state)

You can use

./build.sh importconfig
./build.sh config # menuconfig,search with / and jump to it with 1