pussuw commented on PR #2159:
URL: https://github.com/apache/nuttx-apps/pull/2159#issuecomment-1780631068
@masayuki2009 I found that only SMP is affected, but it does not matter if
the sched_lock() is there or not. Also it seems that only kernel memory is
affected, but also the page pool memory is not freed after the "hello" image is
unloaded. I will continue to investigate.
```
No SMP, with sched lock
ABC
NuttShell (NSH) NuttX-10.4.0
nsh> free
total used free largest nused nfree
Kmem: 2065400 13928 2051472 2051040 41 3
Page: 4194304 606208 3588096 3588096
nsh> hello
Hello, World!!
nsh> free
total used free largest nused nfree
Kmem: 2065400 13928 2051472 2051040 41 3
Page: 4194304 606208 3588096 3588096
No SMP, without sched lock
ABC
NuttShell (NSH) NuttX-10.4.0
nsh> free
total used free largest nused nfree
Kmem: 2065400 13928 2051472 2051040 41 3
Page: 4194304 606208 3588096 3588096
nsh> hello
Hello, World!!
nsh> free
total used free largest nused nfree
Kmem: 2065400 13928 2051472 2051040 41 3
Page: 4194304 606208 3588096 3588096
With SMP, without sched lock
NuttShell (NSH) NuttX-10.4.0
nsh> ps
PID GROUP CPU PRI POLICY TYPE NPX STATE EVENT SIGMASK
STACK USED FILLED COMMAND
0 0 0 0 FIFO Kthread N-- Assigned 0000000000000000
003056 001640 53.6% CPU0 IDLE
1 1 1 0 FIFO Kthread N-- Running 0000000000000000
003056 001136 37.1% CPU1 IDLE
2 2 2 0 FIFO Kthread N-- Running 0000000000000000
003056 001136 37.1% CPU2 IDLE
3 3 3 0 FIFO Kthread N-- Running 0000000000000000
003056 001136 37.1% CPU3 IDLE
4 4 --- 100 RR Kthread --- Waiting Semaphore 0000000000000000
001968 000704 35.7% lpwork 0x802057d0 0x802057f8
5 5 0 100 RR Task --- Running 0000000000000000
003008 001320 43.8% /system/bin/init
nsh> free
total used free largest nused nfree
Kmem: 2053120 17632 2035488 2034656 56 3
Page: 4194304 602112 3592192 3592192
nsh> hello
Hello, World!!
nsh> free
total used free largest nused nfree
Kmem: 2053120 21216 2031904 2031568 59 4
Page: 4194304 1159168 3035136 3035136
nsh> hello
Hello, World!!
nsh> free
total used free largest nused nfree
Kmem: 2053120 24688 2028432 2028112 61 3
Page: 4194304 1159168 3035136 2478080
nsh>
NuttShell (NSH) NuttX-10.4.0
nsh> ps
PID GROUP CPU PRI POLICY TYPE NPX STATE EVENT SIGMASK
STACK USED FILLED COMMAND
0 0 0 0 FIFO Kthread N-- Assigned 0000000000000000
003056 001952 63.8% CPU0 IDLE
1 1 1 0 FIFO Kthread N-- Running 0000000000000000
003056 001136 37.1% CPU1 IDLE
2 2 2 0 FIFO Kthread N-- Running 0000000000000000
003056 001136 37.1% CPU2 IDLE
3 3 3 0 FIFO Kthread N-- Running 0000000000000000
003056 001136 37.1% CPU3 IDLE
4 4 --- 100 RR Kthread --- Waiting Semaphore 0000000000000000
001968 000704 35.7% lpwork 0x802057d0 0x802057f8
5 5 0 100 RR Task --- Running 0000000000000000
003008 001320 43.8% /system/bin/init
nsh> free
total used free largest nused nfree
Kmem: 2053120 17632 2035488 2034656 56 3
Page: 4194304 602112 3592192 3592192
nsh> hello
Hello, World!!
nsh> free
total used free largest nused nfree
Kmem: 2053120 21216 2031904 2031568 59 4
Page: 4194304 1159168 3035136 3035136
nsh> hello
Hello, World!!
nsh> free
total used free largest nused nfree
Kmem: 2053120 24688 2028432 2028112 61 3
Page: 4194304 1159168 3035136 2478080
nsh>
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]