简体   繁体   English

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

[英]Debugging page allocation failure on Coldfire uCLinux

I'm sometimes getting this crash output below on my Coldfire uCLinux system.我有时会在我的 Coldfire uCLinux 系统上遇到以下崩溃 output。 How do I work out what's causing the problem?我如何找出导致问题的原因?

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:

Your system has run out of 1 MB free pages.您的系统已用完 1 MB 的可用页面。 With the power of two allocator, you need a free page of size 1 MB to allocate 663552 byes.借助两个分配器的强大功能,您需要一个大小为 1 MB 的空闲页面来分配 663552 个字节。 This is caused by memory fragmentation.这是memory分片造成的。 Normally, an MMU would reorganize the free space so that it appears contiguous for new allocations.通常,MMU 会重新组织可用空间,以便它在新分配时看起来是连续的。

You can only take care of the problem through prevention.您只能通过预防来解决问题。 If the 663552 bytes are the sh binary, you will have to prevent it from being continously re-loaded into memory. This might be done by putting it into an XIP file system.如果 663552 字节是 sh 二进制文件,您将必须防止它被不断地重新加载到 memory 中。这可以通过将它放入 XIP 文件系统来完成。

It might be a heap allocation done by the shell. In this case, you will have to change whatever processing is causing such a large malloc.它可能是由 shell 完成的堆分配。在这种情况下,您将不得不更改导致如此大的 malloc 的任何处理。

At the system level, you will also have to see which programs are large or cause large mallocs and change their behavior so that they don't cause more fragmentation.在系统级别,您还必须查看哪些程序很大或导致大型 malloc 并更改它们的行为,以免它们导致更多碎片。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM