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 2020/10/08 06:46:15 UTC

[GitHub] [incubator-nuttx] masayuki2009 opened a new pull request #1951: sched: task: Fix nxtask_exit() for SMP

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


   ## Summary
   
   - During Wi-Fi audio streaming test, I found a deadlock in nxtask_exit()
   - Actually, nxtask_exit() was called and tried to enter critical section
   - In enter_critical_section(), there is a deadlock avoidance logic
   - However, if switched to a new rtcb with irqcount=0, the logic did not work
   - Because the 2nd critical section was treated as if it were the 1st one
   - Actually, it tried to run the deadlock avoidance logic
   - But nxtask_exit() was called with critical section (i.e. IRQ already disabled)
   - So the logic did not work as expected because up_irq_restore() did not enable the IRQ.
   - This commit fixes this issue by incrementing irqcount before calling nxtask_terminate()
   - Also it adjusts g_cpu_irqlock and g_cpu_lockset
   
   ## Impact
   
   - Affects SMP only
   
   ## Testing
   
   - Tested with spresense:wifi_smp (smp, ostest, nxplayer, telnetd)
   - Tested with sabre-6quad:smp with QEMU (smp, ostest)
   - Tested with maix-bit:smp with QEMU (smp, ostest)
   - Tested with esp32-core:smp with QEMU (smp, ostest)
   
   


----------------------------------------------------------------
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.

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



[GitHub] [incubator-nuttx] btashton commented on pull request #1951: sched: task: Fix nxtask_exit() for SMP

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


   @masayuki2009 You have made a few SMP related patches like this one the last week.  Do you want to backport these in the 10.0.0 release?


----------------------------------------------------------------
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.

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



[GitHub] [incubator-nuttx] masayuki2009 commented on pull request #1951: sched: task: Fix nxtask_exit() for SMP

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


   @patacongo 
   Could you please review this PR?
   


----------------------------------------------------------------
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.

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



[GitHub] [incubator-nuttx] masayuki2009 commented on pull request #1951: sched: task: Fix nxtask_exit() for SMP

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


   @patacongo 
   Could you please review this PR?
   


----------------------------------------------------------------
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.

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



[GitHub] [incubator-nuttx] patacongo merged pull request #1951: sched: task: Fix nxtask_exit() for SMP

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


   


----------------------------------------------------------------
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.

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



[GitHub] [incubator-nuttx] masayuki2009 commented on pull request #1951: sched: task: Fix nxtask_exit() for SMP

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


   @patacongo 
   Thanks for merging this PR
   
   @btashton 
   Yes. I would appreciate if SMP related fixes could be backported to the 10.0.0 release.
   


----------------------------------------------------------------
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.

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