[Buildroot] [PATCH 1/1] configs/stm32f769_disco_sd_defconfig: new defconfig

Giulio Benetti giulio.benetti at benettiengineering.com
Tue Apr 25 20:18:07 UTC 2023


Hi Dario,

> Il giorno 25 apr 2023, alle ore 21:50, Dario Binacchi <dario.binacchi at amarulasolutions.com> ha scritto:
> 
> Hi Giulio,
> 
>> On Sun, Apr 23, 2023 at 10:31 PM Giulio Benetti
>> <giulio.benetti at benettiengineering.com> wrote:
>> 
>> Hi Dario,
>> 
>> On 23/04/23 19:20, Dario Binacchi wrote:
>> [ SNIP ]
>> 
>>>> 
>>>> Sure. Could you also try to fill the memory and see if everything works correctly?
>>>> You could try to start many instances of a program until you fill the memory and see that everything is working ok(I hope).
>>> 
>>> 
>>> I just uploaded version 2 with your suggested changes. I did some
>>> tests with can applications (candump, cansend, ...) and had
>>> no problems.
>>> But for example, running the ifconfig application, the second time I
>>> got this error:
>>> 
>>> ~ # candump can2 -L &
>>> [18] 81 candump can2 -L
>>> ~ # ifconfig
>>> Segmentation fault
>>> ~ # [  193.040912] warn_alloc: 1 callbacks suppressed
>>> [  193.040970] ifconfig: page allocation failure: order:7,
>>> mode:0xcc0(GFP_KERNEL), nodemask=(null)
>>> [  193.041056] CPU: 0 PID: 82 Comm: ifconfig Not tainted 5.19.0-rc2 #8
>>> [  193.041110] Hardware name: STM32 (Device Tree Support)
>>> [  193.041147]  unwind_backtrace from show_stack+0xb/0xc
>>> [  193.041252]  show_stack from dump_stack_lvl+0x19/0x1e
>>> [  193.041347]  dump_stack_lvl from warn_alloc+0x61/0xe8
>>> [  193.041434]  warn_alloc from __alloc_pages+0x36f/0x57e
>>> [  193.041511]  __alloc_pages from __get_free_pages+0xf/0x24
>>> [  193.041583]  __get_free_pages from alloc_pages_exact+0x45/0x5c
>>> [  193.041656]  alloc_pages_exact from do_mmap+0x491/0x556
>>> [  193.041752]  do_mmap from vm_mmap_pgoff+0x53/0x84
>>> [  193.041858]  vm_mmap_pgoff from load_flat_binary+0x501/0x690
>>> [  193.041960]  load_flat_binary from bprm_execve+0x1f5/0x2f4
>>> [  193.042044]  bprm_execve from do_execveat_common+0x10f/0x12c
>>> [  193.042119]  do_execveat_common from sys_execve+0x1d/0x20
>>> [  193.042195]  sys_execve from ret_fast_syscall+0x1/0x4c
>>> [  193.042262] Exception stack(0xc0ddbfa8 to 0xc0ddbff0)
>>> [  193.042324] bfa0:                   c0e6eff0 c0e68fa7 c0e6eff0
>>> c0c6e420 c0c6e028 0000000b
>>> [  193.042389] bfc0: c0e6eff0 c0e68fa7 c0e68b88 0000000b c0e6eff6
>>> 00000ff6 c0e626f4 00000000
>>> [  193.042438] bfe0: 6962732f c0e68b88 c0e0f7df c0e15db4
>>> [  193.042873] Mem-Info:
>>> [  193.042910] active_anon:0 inactive_anon:0 isolated_anon:0
>>> [  193.042910]  active_file:0 inactive_file:18 isolated_file:0
>>> [  193.042910]  unevictable:5 dirty:0 writeback:4
>>> [  193.042910]  slab_reclaimable:281 slab_unreclaimable:511
>>> [  193.042910]  mapped:0 shmem:0 pagetables:0 bounce:0
>>> [  193.042910]  kernel_misc_reclaimable:0
>>> [  193.042910]  free:1426 free_pcp:0 free_cma:0
>>> [  193.043049] Node 0 active_anon:0kB inactive_anon:0kB
>>> active_file:0kB inactive_file:72kB unevictable:20kB isolated(anon):0kB
>>> isolated(file):0kB mapped:0kB dirty:0kB writeback:16kB shmem:0kB
>>> writeback_tmp:0kB kernel_stack:400kB pagetables:0kB all_unreclaimable?
>>> no
>>> [  193.043162] Normal free:5704kB boost:0kB min:444kB low:552kB
>>> high:660kB reserved_highatomic:0KB active_anon:0kB inactive_anon:0kB
>>> active_file:0kB inactive_file:72kB unevictable:20kB writepending:16kB
>>> present:16384kB managed:12544kB mlocked:0kB bounce:0kB free_pcp:0kB
>>> local_pcp:0kB free_cma:0kB
>>> [  193.043295] lowmem_reserve[]: 0 0
>>> [  193.043352] Normal: 22*4kB (UM) 32*8kB (UM) 23*16kB (UM) 20*32kB
>>> (UM) 20*64kB (UM) 0*128kB 12*256kB (UM) 0*512kB 0*1024kB 0*2048kB
>>> 0*4096kB = 5704kB
>>> [  193.043729] 23 total pagecache pages
>>> [  193.043748] 4096 pages RAM
>>> [  193.043765] 0 pages HighMem/MovableOnly
>>> [  193.043783] 960 pages reserved
>>> [  193.043805] nommu: Allocation of length 430080 from process 82
>>> (ifconfig) failed
>>> [  193.043843] active_anon:0 inactive_anon:0 isolated_anon:0
>>> [  193.043843]  active_file:0 inactive_file:18 isolated_file:0
>>> [  193.043843]  unevictable:5 dirty:0 writeback:4
>>> [  193.043843]  slab_reclaimable:281 slab_unreclaimable:511
>>> [  193.043843]  mapped:0 shmem:0 pagetables:0 bounce:0
>>> [  193.043843]  kernel_misc_reclaimable:0
>>> [  193.043843]  free:1426 free_pcp:0 free_cma:0
>>> [  193.043965] Node 0 active_anon:0kB inactive_anon:0kB
>>> active_file:0kB inactive_file:72kB unevictable:20kB isolated(anon):0kB
>>> isolated(file):0kB mapped:0kB dirty:0kB writeback:16kB shmem:0kB
>>> writeback_tmp:0kB kernel_stack:400kB pagetables:0kB all_unreclaimable?
>>> no
>>> [  193.044073] Normal free:5704kB boost:0kB min:444kB low:552kB
>>> high:660kB reserved_highatomic:0KB active_anon:0kB inactive_anon:0kB
>>> active_file:0kB inactive_file:72kB unevictable:20kB writepending:16kB
>>> present:16384kB managed:12544kB mlocked:0kB bounce:0kB free_pcp:0kB
>>> local_pcp:0kB free_cma:0kB
>>> [  193.044206] lowmem_reserve[]: 0 0
>>> [  193.044260] Normal: 22*4kB (UM) 32*8kB (UM) 23*16kB (UM) 20*32kB
>>> (UM) 20*64kB (UM) 0*128kB 12*256kB (UM) 0*512kB 0*1024kB 0*2048kB
>>> 0*4096kB = 5704kB
>>> [  193.044638] 23 total pagecache pages
>>> [  193.044670] binfmt_flat: Unable to allocate RAM for process
>>> text/data, errno -12
>>> 
>>> Was it similar to your problem?
>> 
>> Yes, this error could be caused by the bug I've fixed and I've seen
>> you've used Linux 5.19-rc2. In this version there is not my bugfix
>> and in general it should be avoided to use rc versions.
>> 
>> This is the patch that fixes ZERO_PAGE(0) that is dedicated to
>> massive "memset()" in the kernel, so it's used pretty often.
>> In my case it failed to allocate it, so since in your backtrace
>> there is try to allocate it could be fixed by my patch, also because
>> you have 5MB free and they look enough for ifconfig.
>> 
>> Can you give a try with 5.15.108 and repeat the same test please?
>> Otherwise I'd need to enter debug with this board but I don't have it
>> and this kind of bugs are subtle to catch and fix.
> 
> I did further tests with version 6.2 (stm32f469-disco, stm32f429-disco and
> stm32f769-disco) and the situation definitely improved. Without your patch,
> even a simple reboot command was causing problems.

I’m very happy it fixed the problem :-)

> I had only one problem like
> this and not deterministic:
> 
> ~ # ps
> [  102.396252] ps: page allocation failure: order:7,
> mode:0xcc0(GFP_KERNEL), nodemask=(null)
> [  102.404509] CPU: 0 PID: 62 Comm: ps Not tainted 6.2.9 #4
> [  102.409911] Hardware name: STM32 (Device Tree Support)
> [  102.415096]  unwind_backtrace from show_stack+0xb/0xc
> [  102.420169]  show_stack from dump_stack_lvl+0x19/0x1e
> [  102.425334]  dump_stack_lvl from warn_alloc+0x5f/0xf4
> [  102.430409]  warn_alloc from __alloc_pages+0x36f/0x57e
> [  102.435675]  __alloc_pages from __get_free_pages+0xf/0x24
> [  102.441149]  __get_free_pages from alloc_pages_exact+0x45/0x5c
> [  102.447031]  alloc_pages_exact from do_mmap+0x4c3/0x5d2
> [  102.452288]  do_mmap from vm_mmap_pgoff+0x53/0x84
> [  102.457022]  vm_mmap_pgoff from load_flat_binary+0x4f9/0x688
> [  102.462777]  load_flat_binary from bprm_execve+0x1f9/0x2f4
> [  102.468346]  bprm_execve from do_execveat_common+0x10f/0x12c
> [  102.474023]  do_execveat_common from sys_execve+0x1d/0x20
> [  102.479492]  sys_execve from ret_fast_syscall+0x1/0x4c
> [  102.484628] Exception stack(0xc07dbfa8 to 0xc07dbff0)
> [  102.489838] bfa0:                   c0c6aff7 c0c68fa2 c0c6aff7
> c07e86b8 c056a028 0000000b
> [  102.498014] bfc0: c0c6aff7 c0c68fa2 c0c68b88 0000000b c0c6affc
> 00000ffc c0c62734 00000000
> [  102.506278] bfe0: 3a6e6962 c0c68b88 c0c0f7c7 c0c15d94
> [  102.515871] Mem-Info:
> [  102.518121] active_anon:0 inactive_anon:0 isolated_anon:0
> [  102.518121]  active_file:50 inactive_file:29 isolated_file:0
> [  102.518121]  unevictable:5 dirty:4 writeback:0
> [  102.518121]  slab_reclaimable:287 slab_unreclaimable:460
> [  102.518121]  mapped:0 shmem:0 pagetables:0
> [  102.518121]  sec_pagetables:0 bounce:0
> [  102.518121]  kernel_misc_reclaimable:0
> [  102.518121]  free:1785 free_pcp:0 free_cma:0
> [  102.556022] Node 0 active_anon:0kB inactive_anon:0kB
> active_file:200kB inactive_file:116kB unevictable:20kB
> isolated(anon):0kB isolated(file):0kB mapped:0kB dirty:16kB
> writeback:0kB shmem:0kB writeback_tmp:0kB kernel_stack:272kB
> pagetables:0kB sec_pagetables:0kB all_unreclaimable? no
> [  102.581731] Normal free:7172kB boost:0kB min:440kB low:548kB
> high:656kB reserved_highatomic:0KB active_anon:0kB inactive_anon:0kB
> active_file:200kB inactive_file:116kB unevictable:20kB
> writepending:16kB present:16384kB managed:12356kB mlocked:0kB
> bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:0kB
> [  102.608439] lowmem_reserve[]: 0 0
> [  102.611733] Normal: 25*4kB (UM) 20*8kB (UM) 10*16kB (UM) 21*32kB
> (UM) 19*64kB (UM) 10*128kB (UM) 14*256kB (U) 0*512kB 0*1024kB 0*2048kB
> 0*4096kB = 7172kB
> [  102.626183] 84 total pagecache pages
> [  102.629735] 4096 pages RAM
> [  102.632444] 0 pages HighMem/MovableOnly
> [  102.636362] 1007 pages reserved
> [  102.639494] nommu: Allocation of length 430080 from process 62 (ps) failed
> [  102.646491] active_anon:0 inactive_anon:0 isolated_anon:0
> [  102.646491]  active_file:50 inactive_file:29 isolated_file:0
> [  102.646491]  unevictable:5 dirty:4 writeback:0
> [  102.646491]  slab_reclaimable:279 slab_unreclaimable:460
> [  102.646491]  mapped:0 shmem:0 pagetables:0
> [  102.646491]  sec_pagetables:0 bounce:0
> [  102.646491]  kernel_misc_reclaimable:0
> [  102.646491]  free:1793 free_pcp:0 free_cma:0
> [  102.683596] Node 0 active_anon:0kB inactive_anon:0kB
> active_file:200kB inactive_file:116kB unevictable:20kB
> isolated(anon):0kB isolated(file):0kB mapped:0kB dirty:16kB
> writeback:0kB shmem:0kB writeback_tmp:0kB kernel_stack:272kB
> pagetables:0kB sec_pagetables:0kB all_unreclaimable? no
> [  102.708986] Normal free:7172kB boost:0kB min:440kB low:548kB
> high:656kB reserved_highatomic:0KB active_anon:0kB inactive_anon:0kB
> active_file:200kB inactive_file:116kB unevictable:20kB
> writepending:16kB present:16384kB managed:12356kB mlocked:0kB
> bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:0kB
> [  102.735642] lowmem_reserve[]: 0 0
> [  102.738928] Normal: 25*4kB (UM) 20*8kB (UM) 10*16kB (UM) 21*32kB
> (UM) 19*64kB (UM) 10*128kB (UM) 14*256kB (U) 0*512kB 0*1024kB 0*2048kB
> 0*4096kB = 7172kB
> [  102.753269] 84 total pagecache pages
> [  102.756881] binfmt_flat: Unable to allocate RAM for process
> text/data, errno -12
> Segmentation fault

Another bug on nommu arm :-/

I can give a try on imxrt1050 evk and see if ps repeatedly issued gives me the same problem, but it could hide the problem since it has 32MB of sdram.

Fortunately I’ve found I have a stm32f429-disco so I can give a try on that soon or late by entering debugging.

I think that for the moment your patches with Linux bumped including my patch should be enough and once I will have time to deal with this new Linux bug and I fix it then you can bump again.

So can you please resend patches using latest stable 5.15.x Linux that includes my patch?
This way stm32 nommu boards will work better than before for sure.
I can give a quick test on stm32f429-disco then and add my tested tag.

Thank you!

Best regards
—
Giulio Benetti
CEO/CTO at Benetti Engineering sas

> 
> Thanks and regards,
> Dario
>> 
>> Thank you!
>> 
>> Best regards
>> --
>> Giulio Benetti
>> Benetti Engineering sas
> 
> 
> 
> -- 
> 
> Dario Binacchi
> 
> Senior Embedded Linux Developer
> 
> dario.binacchi at amarulasolutions.com
> 
> __________________________________
> 
> 
> Amarula Solutions SRL
> 
> Via Le Canevare 30, 31100 Treviso, Veneto, IT
> 
> T. +39 042 243 5310
> info at amarulasolutions.com
> 
> www.amarulasolutions.com




More information about the buildroot mailing list