This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Issue about the Linux kernel error "swapper: page allocation failure. order:0, mode:0x4020"



Hello,guys:
We met with some difficulties when testing our own application based on DM8168 & DVRRDK 3.0.We use a PCI-E net interface card (RTL8111) to receive TCP data and write them to a sata disk. After the app running for a period of time, more than an hour,the kernel prints"swapper: page allocation failure. order:0, mode:0x4020".

The command "top" shows the info as follow:
Mem: 229112K used, 4804K free, 0K shrd, 30228K buff, 162108K cached
CPU: 2% usr 11% sys 0% nic 81% idle 3% io 0% irq 1% sirq
Load average: 0.21 0.63 1.96 3/60 1140
PID PPID USER STAT VSZ %MEM %CPU COMMAND
1117 1113 root S 55228 24% 12% ./hb154-tcpd
We can see the app only takes 24% of the memory,we'll be so appreciated if anyone of you could show some useful advice to solve this problem.

Detail log info:

swapper: page allocation failure. order:0, mode:0x4020

Backtrace: 

[<8004ab7c>] (dump_backtrace+0x0/0x10c) from [<803c709c>] (dump_stack+0x18/0x1c)
r7:8e402400 r6:00004020 r5:003fffff r4:00000000
[<803c7084>] (dump_stack+0x0/0x1c) from [<800aa044>] (__alloc_pages_nodemask+0x)
[<800a9b7c>] (__alloc_pages_nodemask+0x0/0x51c) from [<800c7540>] (new_slab+0x8)
[<800c74c0>] (new_slab+0x0/0x218) from [<800c7824>] (__slab_alloc+0x14c/0x228)
r9:8d484340 r8:ffffffff r7:00000020 r6:8e402400 r5:00000000
r4:8e401100
[<800c76d8>] (__slab_alloc+0x0/0x228) from [<800c7990>] (__kmalloc_track_caller)
[<800c7900>] (__kmalloc_track_caller+0x0/0xc8) from [<8033f5b4>] (__alloc_skb+0)
r8:803405fc r7:00000640 r6:00000020 r5:8bd420c0 r4:8e402100
[<8033f55c>] (__alloc_skb+0x0/0xe8) from [<803405fc>] (dev_alloc_skb+0x20/0x44)
[<803405dc>] (dev_alloc_skb+0x0/0x44) from [<7f00282c>] (rtl8168_rx_fill+0x54/0)
[<7f0027d8>] (rtl8168_rx_fill+0x0/0x108 [r8168]) from [<7f002bf8>] (rtl8168_rx_)
[<7f0028e0>] (rtl8168_rx_interrupt+0x0/0x3b0 [r8168]) from [<7f00719c>] (rtl816)
[<7f006f2c>] (rtl8168_interrupt+0x0/0x414 [r8168]) from [<8009c62c>] (handle_IR)
[<8009c600>] (handle_IRQ_event+0x0/0xec) from [<8009e810>] (handle_level_irq+0x)
r7:00000031 r6:8054eb98 r5:00000170 r4:8052b9f4
[<8009e764>] (handle_level_irq+0x0/0x11c) from [<8005ea78>] (ti81xx_msi_handler)
r5:80525148 r4:00000170
[<8005ea08>] (ti81xx_msi_handler+0x0/0xb0) from [<8003c07c>] (asm_do_IRQ+0x7c/0)
r7:8050c0f4 r6:8002f5dc r5:00000000 r4:00000031
[<8003c000>] (asm_do_IRQ+0x0/0xa0) from [<803c9134>] (__irq_svc+0x34/0xa0)
Exception stack(0x80509f48 to 0x80509f90)
9f40: 81600281 40000013 80509f90 00000814 00000816 8054e680
9f60: 8002f5dc 8050c0f4 80000000 413fc082 0000001f 80509fa4 80509f90 80509f90
9f80: 80047f4c 80047f50 20000013 ffffffff
r5:fa200000 r4:ffffffff
[<80047ee4>] (default_idle+0x0/0x78) from [<800484f8>] (cpu_idle+0x50/0x90)
r5:8054e680 r4:80508000
[<800484a8>] (cpu_idle+0x0/0x90) from [<803bdb9c>] (rest_init+0x60/0x78)
r5:8054e680 r4:805729b4
[<803bdb3c>] (rest_init+0x0/0x78) from [<80008c6c>] (start_kernel+0x258/0x2ac)
[<80008a14>] (start_kernel+0x0/0x2ac) from [<80008044>] (stext+0x44/0x54)
Mem-info:
Normal per-cpu:
CPU 0: hi: 90, btch: 15 usd: 42
active_anon:458 inactive_anon:21 isolated_anon:0
active_file:6984 inactive_file:41493 isolated_file:32
unevictable:0 dirty:8293 writeback:1218 unstable:0
free:182 slab_reclaimable:6355 slab_unreclaimable:1915
mapped:346 shmem:34 pagetables:67 bounce:0
Normal free:728kB min:1956kB low:2444kB high:2932kB active_anon:1832kB inactiveo
lowmem_reserve[]: 0 0 0
Normal: 176*4kB 1*8kB 1*16kB 0*32kB 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2B
48542 total pagecache pages
65536 pages of RAM
333 free pages
7057 reserved pages
7628 slab pages
49814 pages shared
0 pages swap cached
SLUB: Unable to allocate memory on node -1 (gfp=0x20)
cache: kmalloc-2048, object size: 2048, buffer size: 2048, default order: 2, 0
node 0: slabs: 563, objs: 2140, free: 0

Best wishes!

  • Hi

    Can you attach the output of free command - you can monitor the status of memory used in the system periodically using the top command (if you can launch a telnet session, you could keep running the free command periodically with the watch command). Looking at the log , looks like the amount of free memory in the system is less or there is a possiblity that the free memory in the system is decreasing progressively - monitoring "free" command should help ascertain the actual scenario

    Regards

    Sriram

  • I've done some tests, here's the result, command "top" is executed every 60 second :

    when Linux is just booted:

    Mem: 15748K used, 218100K free, 0K shrd, 544K buff, 4280K cached

    after our app is running:

    Mem: 230744K used, 3104K free, 0K shrd, 12360K buff, 182504K cached
    Mem: 229936K used, 3912K free, 0K shrd, 12508K buff, 181256K cached
    Mem: 230928K used, 2920K free, 0K shrd, 12736K buff, 181448K cached
    Mem: 229704K used, 4144K free, 0K shrd, 12928K buff, 179452K cached
    Mem: 230528K used, 3320K free, 0K shrd, 13136K buff, 179792K cached
    Mem: 230684K used, 3164K free, 0K shrd, 13356K buff, 179192K cached
    Mem: 229856K used, 3992K free, 0K shrd, 13520K buff, 180384K cached
    Mem: 231040K used, 2808K free, 0K shrd, 13712K buff, 181384K cached
    Mem: 230364K used, 3484K free, 0K shrd, 13972K buff, 177676K cached
    Mem: 230812K used, 3036K free, 0K shrd, 14136K buff, 180900K cached
    Mem: 230504K used, 3344K free, 0K shrd, 14352K buff, 177380K cached
    Mem: 231396K used, 2452K free, 0K shrd, 14556K buff, 180796K cached

    ......

    The "free" memory keeps low and the "buff" memory keeps high. And it seems the "buff" memory keeps increasing.

    when kernel error occured:

    Mem: 228712K used, 5136K free, 0K shrd, 17080K buff, 172124K cached
    Mem: 230352K used, 3496K free, 0K shrd, 19584K buff, 173776K cached
    Mem: 227468K used, 6380K free, 0K shrd, 22076K buff, 165592K cached