首页 > 解决方案 > STM32f769 上的 noMMU UcLinux 内存不足

问题描述

我正在尝试在具有 16MB RAM 的 STM32F769 (cortex m7) 平台上运行基于 noMMU UcLinux buildroot 的发行版。

最后,似乎有超过 4MB 的可用内存,但它似乎被分组为许多较小的块,而不是几个更大的块。

当我以平面格式运行一些更大的编译二进制文件时,我会遇到段错误,因为无法分配内存来启动应用程序。

我在 strace、openssl、蚊子上遇到了类似的错误(而且似乎在任何更大的应用程序上):

~ # strace
strace: page allocation failure: order:8, mode:0xcc0(GFP_KERNEL), nodemask=(null)
nommu: Allocation of length 839680 from process 83 (strace) failed
binfmt_flat: Unable to allocate RAM for process text/data, errno -12
SEGV

和 dmesg 显示:

nommu: Allocation of length 839680 from process 81 (strace) failed
active_anon:0 inactive_anon:0 isolated_anon:0
active_file:14 inactive_file:21 isolated_file:0
unevictable:202 dirty:3 writeback:0 unstable:0
slab_reclaimable:0 slab_unreclaimable:808
mapped:0 shmem:0 pagetables:0 bounce:0
free:1128 free_pcp:0 free_cma:0
Node 0 active_anon:0kB inactive_anon:0kB active_file:56kB inactive_file:84kB unevictable:808kB isolated(anon):0kB isolated(file):0kB mapped:0kB dirty:12kB writeback:0kB shmem:0kB writeback_tmp:0kB unstable:0kB all_unreclaimable? no
Normal free:4512kB min:432kB low:540kB high:648kB reserved_highatomic:0KB active_anon:0kB inactive_anon:0kB active_file:56kB inactive_file:84kB unevictable:808kB writepending:12kB present:15296kB managed:11864kB mlocked:0kB kernel_stack:264kB pagetables:0kB bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:0kB
lowmem_reserve[]: 0 0
Normal: 28*4kB (UM) 24*8kB (UM) 13*16kB (UM) 11*32kB (UM) 13*64kB (UM) 8*128kB (UM) 3*256kB (UM) 2*512kB (M) 0*1024kB 0*2048kB 0*4096kB = 4512kB
237 total pagecache pages
binfmt_flat: Unable to allocate RAM for process text/data, errno -12

我不确定我是否理解正确,但最后一行解释了可用的分配可能性。

Normal: 28*4kB (UM) 24*8kB (UM) 13*16kB (UM) 11*32kB (UM) 13*64kB (UM) 8*128kB (UM) 3*256kB (UM) 2*512kB (M) 0*1024kB 0*2048kB 0*4096kB = 4512kB
237 total pagecache pages

总体看来内存是足够的,但我不明白为什么它如此碎片化并分组为许多较小的块。

这是否是内存碎片的结果并且无法改进?

或者是否有可能获得更大的可用内存块,因此我的二进制文件将能够进入内存以在没有段错误的情况下执行?我记得较旧的内核有 BIGALOCS 配置选项,但它似乎不再存在。

有什么建议、经验、例子或文档可以学习吗?

提前致谢,

问候,

抢。

标签: clinuxmemorycortex-muclinux

解决方案


推荐阅读