在Coldfire uCLinux上调试页面分配失败

时间:2012-04-05 18:29:43

标签: embedded-linux uclinux coldfire

我有时会在我的Coldfire uCLinux系统上获得此崩溃输出。我如何找出导致问题的原因?

Apr  4 10:44:33 (none) user.debug syslog: starting NTP
sh: page allocation failure. order:8, mode:0xd0
Stack from 41da5dcc:
        4005b0f2 400553b6 40207431 406131f8 00000008 000000d0 00000008 00000000
        000000a2 000a2000 000a2000 0000000c 40544a14 00000000 405434fc 00000077
        41da5eac 00000000 00000010 00000000 41da5008 41da5000 00000000 00000100
        00000000 41da5000 00000000 000200d0 4024eecc 00000080 00000000 00000000
        4005de52 000000d0 00000008 4024eec8 00000000 00000001 00004d09 00079100
        00000004 00003f20 00013424 41cd7000 41da5fcc 41da5f2a 00015790 00000000
Call Trace with CONFIG_FRAME_POINTER disabled:

 [4005b0f2]  [400553b6]  [40207431]  [4005de52]  [40067d64]
 [40093892]  [4004b15e]  [400390d8]  [40020e70]  [400677d8]
 [40020e70]  [401f0c92]  [40068468]  [4006aa4e]  [40020ea0]
 [4002386c]
Mem-Info:
DMA per-cpu:
CPU    0: hi:    0, btch:   1 usd:   0
Active_anon:0 active_file:0 inactive_anon:0
 inactive_file:4484 dirty:0 writeback:0 unstable:0
 free:8806 slab:565 mapped:0 pagetables:0 bounce:0
DMA free:35216kB min:1016kB low:1268kB high:1524kB active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:17936kB present:65024kB pages_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 0 0
DMA: 0*4kB 0*8kB 1*16kB 4*32kB 6*64kB 3*128kB 46*256kB 44*512kB 0*1024kB 0*2048kB 0*4096kB 0*8192kB 0*16384kB = 35216kB
4484 total pagecache pages
0 pages RAM
0 pages reserved
0 pages shared
0 pages non-shared
Allocation of length 663552 from process 476 (sh) failed
DMA per-cpu:
CPU    0: hi:    0, btch:   1 usd:   0
Active_anon:0 active_file:0 inactive_anon:0
 inactive_file:4484 dirty:0 writeback:0 unstable:0
 free:8804 slab:567 mapped:0 pagetables:0 bounce:0
DMA free:35216kB min:1016kB low:1268kB high:1524kB active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:17936kB present:65024kB pages_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 0 0
DMA: 0*4kB 0*8kB 1*16kB 4*32kB 6*64kB 3*128kB 46*256kB 44*512kB 0*1024kB 0*2048kB 0*4096kB 0*8192kB 0*16384kB = 35216kB
4484 total pagecache pages
Unable to allocate RAM for process text/data, errno 12
sh: page allocation failure. order:8, mode:0xd0
Stack from 41ea6dcc:
        4005b0f2 400553b6 40207431 40645848 00000008 000000d0 00000008 00000000
        000000a2 000a2000 000a2000 0000000c 40544a6c 00000000 405434fc 00000077
        41ea6eac 00000000 00000010 00000000 41ea6008 41ea6000 00000000 00000100
        00000000 41ea6000 00000000 000200d0 4024eecc 00000080 00000000 00000000
        4005de52 000000d0 00000008 4024eec8 00000000 00000001 00004d09 00079100
        00000004 00003f20 00013424 410ae600 41ea6fcc 41ea6f2a 00015790 00000000
Call Trace with CONFIG_FRAME_POINTER disabled:

 [4005b0f2]  [400553b6]  [40207431]  [4005de52]  [40067d64]
 [40093892]  [4004b15e]  [400390d8]  [40020e70]  [400677d8]
 [40020e70]  [401f0c92]  [40068468]  [4006aa4e]  [40020ea0]
 [400239c2]  [4002386c]
Mem-Info:

1 个答案:

答案 0 :(得分:1)

您的系统已用完1 MB的空闲页面。使用两个分配器的强大功能,您需要一个大小为1 MB的空闲页面来分配663552个byes。这是由内存碎片引起的。通常,MMU会重新组织可用空间,使其看起来与新分配相邻。

您只能通过预防来解决问题。如果663552字节是sh二进制文件,则必须防止它连续重新加载到内存中。这可以通过将其放入XIP文件系统来完成。

它可能是shell完成的堆分配。在这种情况下,您将不得不更改导致如此大型malloc的任何处理。

在系统级别,您还必须查看哪些程序很大或导致大型malloc并改变其行为,以免它们造成更多碎片。