You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/07/01 13:56:46 UTC

[GitHub] [incubator-nuttx] Donny9 opened a new pull request #4026: sched/idle: disable sched when idle call nx_bringup

Donny9 opened a new pull request #4026:
URL: https://github.com/apache/incubator-nuttx/pull/4026


   ## Summary
   Because idle task will call mm_malloc to create some task
   and will take sem of mm. But if smp enable, the sem of mm may be
   taken by other cpu, so idle may be block because take this sem and crash.
   
   Change-Id: I22f0233ef6c59a1b81607d4389e68f8646c89395
   Signed-off-by: Jiuzhu Dong <do...@xiaomi.com>
   ## Impact
   normal boot for smp
   ## Testing
   maual test
   


-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] Donny9 edited a comment on pull request #4026: sched/idle: disable sched when idle call nx_bringup

Posted by GitBox <gi...@apache.org>.
Donny9 edited a comment on pull request #4026:
URL: https://github.com/apache/incubator-nuttx/pull/4026#issuecomment-872968378


   > cxd56_pm_semtake
   
   @masayuki2009  The root cause of deadlock is that new task can't  be sched and post semaphore, because i add sched_lock and sched_unlock before and after nx_bringup. But If we don't lock sched in smp, the system will  crash  because mem issue. How do you think this problem?


-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] Donny9 commented on pull request #4026: sched/idle: disable sched when idle call nx_bringup

Posted by GitBox <gi...@apache.org>.
Donny9 commented on pull request #4026:
URL: https://github.com/apache/incubator-nuttx/pull/4026#issuecomment-872968378


   > cxd56_pm_semtake
   
   The root cause of deadlock is that new task can't  be sched and post semaphore, because i add sched_lock and sched_unlock before and after nx_bringup. But If we don't lock sched in smp, the system will  crash  because mem issue. How do you think this problem?


-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] masayuki2009 commented on pull request #4026: sched/idle: disable sched when idle call nx_bringup

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on pull request #4026:
URL: https://github.com/apache/incubator-nuttx/pull/4026#issuecomment-872990024


   >@masayuki2009 cxd56_bringup shouldn't be called in idle thread and don't wait semaphore, we should fix this issue?
   
   @Donny9 
   Do you mean that we should use ```CONFIG_BOARD_LATE_INITIALIZE=y``` ?
   


-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] Donny9 commented on pull request #4026: sched/idle: disable sched when idle call nx_bringup

Posted by GitBox <gi...@apache.org>.
Donny9 commented on pull request #4026:
URL: https://github.com/apache/incubator-nuttx/pull/4026#issuecomment-872951472


   > spresense
   
   We don't have this hardware, can you  describe this deadlock in more detail, which lock cause the deadlock ? I test this pr in A7 smp, it's normal.


-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on pull request #4026: sched/idle: disable sched when idle call nx_bringup

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on pull request #4026:
URL: https://github.com/apache/incubator-nuttx/pull/4026#issuecomment-872993347


   > @Donny9
   > Though I've never seen such a problem before, can we change this function as optional and select it in Kconfig for your environment?
   
   This is a race condition hard to meet, but it will bite you later eventually. Our SMP system run more than half year without any issue, but stop boot suddenly. A kconfig isn't a good candidate here.


-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] Donny9 commented on pull request #4026: sched/idle: disable sched when idle call nx_bringup

Posted by GitBox <gi...@apache.org>.
Donny9 commented on pull request #4026:
URL: https://github.com/apache/incubator-nuttx/pull/4026#issuecomment-872992722


   > > @masayuki2009 cxd56_bringup shouldn't be called in idle thread and don't wait semaphore, we should fix this issue?
   > 
   > @Donny9
   > Do you mean that we should use `CONFIG_BOARD_LATE_INITIALIZE=y` ?
   
   Yes, you can try.
   


-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] Donny9 commented on pull request #4026: sched/idle: disable sched when idle call nx_bringup

Posted by GitBox <gi...@apache.org>.
Donny9 commented on pull request #4026:
URL: https://github.com/apache/incubator-nuttx/pull/4026#issuecomment-872986717


   > > > cxd56_pm_semtake
   > > 
   > > 
   > > @masayuki2009 The root cause of deadlock is that new task can't be sched and post semaphore, because i add sched_lock and sched_unlock before and after nx_bringup. But If we don't lock sched in smp, the system will crash because mem issue. How do you think this problem?
   > 
   > @Donny9
   > Though I've never seen such a problem before, can we change this function as optional and select it in Kconfig for your environment?
   
   @masayuki2009  cxd56_bringup shouldn't be called in idle thread and don't wait semaphore, we should fix this issue?


-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] masayuki2009 commented on pull request #4026: sched/idle: disable sched when idle call nx_bringup

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on pull request #4026:
URL: https://github.com/apache/incubator-nuttx/pull/4026#issuecomment-873003477


   >This is a race condition hard to meet, but it will bite you later eventually. Our SMP system run more than half year >without any issue, but stop boot suddenly. So a kconfig isn't a good candidate here.
   
   @xiaoxiang781216 
   Thanks for the information.
   I'll try ```CONFIG_BOARD_LATE_INITIALIZE=y```
   


-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] Donny9 commented on pull request #4026: sched/idle: disable sched when idle call nx_bringup

Posted by GitBox <gi...@apache.org>.
Donny9 commented on pull request #4026:
URL: https://github.com/apache/incubator-nuttx/pull/4026#issuecomment-872959486


   > > We don't have this hardware, can you describe this deadlock in more detail, which lock cause the deadlock ?
   > 
   > Though this is spresense specific, it stops in the clock initialization.
   > 
   > ```
   > (gdb) where                                                                                                                                                                                                                                                                                            
   > #0  arm_switchcontext () at armv7-m/gnu/arm_switchcontext.S:79                                                                                                                                                                                                                                         
   > #1  0x0d004be4 in nxsem_wait (sem=sem@entry=0x2d05aab4 <g_freqlockwait>) at semaphore/sem_wait.c:153                                                                                                                                                                                                   
   > #2  0x0d004bfe in nxsem_wait_uninterruptible (sem=sem@entry=0x2d05aab4 <g_freqlockwait>) at semaphore/sem_wait.c:222                                                                                                                                                                                   
   > #3  0x0d0016cc in cxd56_pm_semtake (id=id@entry=0x2d05aab4 <g_freqlockwait>) at chip/cxd56_powermgr.c:177                                                                                                                                                                                              
   > #4  0x0d001712 in cxd56_pm_checkfreqlock () at chip/cxd56_powermgr.c:333                                                                                                                                                                                                                               
   > #5  0x0d0019ee in up_pm_acquire_freqlock (lock=0x2d059624 <g_hv_lock>) at chip/cxd56_powermgr.c:599                                                                                                                                                                                                    
   > #6  0x0d0373be in board_clock_initialize () at board/cxd56_clock.c:52                                                                                                                                                                                                                                  
   > #7  0x0d036c84 in cxd56_bringup () at board/cxd56_bringup.c:252                                                                                                                                                                                                                                        
   > #8  0x00000000 in ?? ()           
   > ```
   
   Thank you , i will check this issue.


-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] masayuki2009 commented on pull request #4026: sched/idle: disable sched when idle call nx_bringup

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on pull request #4026:
URL: https://github.com/apache/incubator-nuttx/pull/4026#issuecomment-872947960


   >@Donny9
   >Hmm, this PR makes deadlock when booting spresesnse:wifi_smp.
   
   @Donny9 @xiaoxiang781216 
   spresense:rndis_smp has the same boot problem now.
   So, if you have spresense, you can try spresense:rndis_smp.
   


-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 edited a comment on pull request #4026: sched/idle: disable sched when idle call nx_bringup

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 edited a comment on pull request #4026:
URL: https://github.com/apache/incubator-nuttx/pull/4026#issuecomment-872993347


   > @Donny9
   > Though I've never seen such a problem before, can we change this function as optional and select it in Kconfig for your environment?
   
   This is a race condition hard to meet, but it will bite you later eventually. Our SMP system run more than half year without any issue, but stop boot suddenly. So a kconfig isn't a good candidate here.


-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] masayuki2009 commented on pull request #4026: sched/idle: disable sched when idle call nx_bringup

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on pull request #4026:
URL: https://github.com/apache/incubator-nuttx/pull/4026#issuecomment-872932172


   @Donny9 
   Hmm, this PR makes deadlock when booting spresesnse:wifi_smp.
   
   


-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 merged pull request #4026: sched/idle: disable sched when idle call nx_bringup

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged pull request #4026:
URL: https://github.com/apache/incubator-nuttx/pull/4026


   


-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] masayuki2009 commented on pull request #4026: sched/idle: disable sched when idle call nx_bringup

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on pull request #4026:
URL: https://github.com/apache/incubator-nuttx/pull/4026#issuecomment-872971671


   > > cxd56_pm_semtake
   > 
   > @masayuki2009 The root cause of deadlock is that new task can't be sched and post semaphore, because i add sched_lock and sched_unlock before and after nx_bringup. But If we don't lock sched in smp, the system will crash because mem issue. How do you think this problem?
   
   @Donny9 
   Though I've never seen such a problem before, can we change this function as optional and select it in Kconfig for your environment?


-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] masayuki2009 commented on pull request #4026: sched/idle: disable sched when idle call nx_bringup

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on pull request #4026:
URL: https://github.com/apache/incubator-nuttx/pull/4026#issuecomment-872956798


   >We don't have this hardware, can you describe this deadlock in more detail, which lock cause the deadlock ?
   
   Though this is spresense specific, it stops in the clock initialization.
   
   ```
   (gdb) where                                                                                                                                                                                                                                                                                            
   #0  arm_switchcontext () at armv7-m/gnu/arm_switchcontext.S:79                                                                                                                                                                                                                                         
   #1  0x0d004be4 in nxsem_wait (sem=sem@entry=0x2d05aab4 <g_freqlockwait>) at semaphore/sem_wait.c:153                                                                                                                                                                                                   
   #2  0x0d004bfe in nxsem_wait_uninterruptible (sem=sem@entry=0x2d05aab4 <g_freqlockwait>) at semaphore/sem_wait.c:222                                                                                                                                                                                   
   #3  0x0d0016cc in cxd56_pm_semtake (id=id@entry=0x2d05aab4 <g_freqlockwait>) at chip/cxd56_powermgr.c:177                                                                                                                                                                                              
   #4  0x0d001712 in cxd56_pm_checkfreqlock () at chip/cxd56_powermgr.c:333                                                                                                                                                                                                                               
   #5  0x0d0019ee in up_pm_acquire_freqlock (lock=0x2d059624 <g_hv_lock>) at chip/cxd56_powermgr.c:599                                                                                                                                                                                                    
   #6  0x0d0373be in board_clock_initialize () at board/cxd56_clock.c:52                                                                                                                                                                                                                                  
   #7  0x0d036c84 in cxd56_bringup () at board/cxd56_bringup.c:252                                                                                                                                                                                                                                        
   #8  0x00000000 in ?? ()           
   ```


-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org